home *** CD-ROM | disk | FTP | other *** search
/ La Bible Des... Jeux / La Bible des... Jeux.iso / Les Sharewares / Société & Divers / Xconq 7.0.1 / doc / refman.texi < prev    next >
Encoding:
Text File  |  1995-08-22  |  204.6 KB  |  6,194 lines  |  [TEXT/MPS ]

  1. @node Reference Manual
  2.  
  3. @chapter Reference Manual
  4.  
  5. This manual is the complete description of GDL.
  6. The style is somewhat terse; for more detail on how to
  7. use GDL to design games, see Chapter 3.
  8.  
  9. Please note that the current version of @i{Xconq} may not fully
  10. implement all of the constructs or combinations of constructs
  11. described here.  Any such omissions should be regarded as bugs.
  12.  
  13. @menu
  14. * Language Syntax::             
  15. * Game Module Forms::                
  16. * World and Area Forms::
  17. * Side and Player Forms::                  
  18. * Unit Forms::                  
  19. * Agreements::                  
  20. * Scorekeeper Forms::                  
  21. * History Forms::                  
  22. * Battle Forms::                  
  23. * Types in General::            
  24. * Unit Types::                  
  25. * Terrain Types::                  
  26. * Material Types::                  
  27. * Static Relationships Between Types::                  
  28. * Vision::                      
  29. * Game Initialization::  
  30. * Synthesis Methods::   
  31. * Setup Postprocessing::        
  32. * Naming and Text Generation::                  
  33. * Actions::          
  34. * Backdrop Environment Parameters::
  35. * Backdrop Economy Parameters::                  
  36. * Random Events::               
  37. * Dates and Time::              
  38. * Image Families::   
  39. * Other Forms::                  
  40. @end menu
  41.  
  42. @node Language Syntax, Game Module Forms, , Reference Manual
  43.  
  44. @section Language Syntax
  45.  
  46. GDL resembles Lisp, but instead of defining functions,
  47. the contents of a file declare
  48. certain objects (such as units and unit types) to exist,
  49. and specify values for their properties.
  50. In other words, GDL is @emph{nonprocedural}.
  51. This means that most of the time, you can list the various
  52. forms in any order you like.
  53. The main restriction is that any symbol, such as a variable
  54. or the name of a type, must be defined before it is used.
  55. Also, forms such as @code{set} and @code{add}, that set the
  56. value of a variable or property,
  57. always overwrite the previous data irreversibly, 
  58. so ordering of these is very important.
  59.  
  60. @menu
  61. * Lexical Elements::            
  62. * Conventions Used::            
  63. * Forms and Evaluation::        
  64. * Tables::                      
  65. * Modifying Objects::           
  66. * Symbols::                     
  67. * Lists::                       
  68. @end menu
  69.  
  70. @node Lexical Elements, Conventions Used, Language Syntax, Language Syntax
  71.  
  72. @subsection Lexical Elements
  73.  
  74. Numbers are introduced by a decimal digit, plus, or minus signs.
  75. They may contain only decimal digits, a decimal point, and be followed
  76. (immediately, no whitespace allowed) by a percent sign.
  77.  
  78. Strings are sequences of characters enclosed by doublequotes (@code{"}).
  79. They may contain any character except ASCII NUL (@code{'\0'}).
  80. To include a doublequote, use backslash, as in @code{"a \"quoted\" string"}.
  81. To include a nonprinting or eight-bit character,
  82. use backslash followed by three octal
  83. digits, which will be interpreted as an eight-bit character code.
  84. (This is mostly the same syntax as in C.)
  85. Note that game design files may be passed over networks
  86. and between different kinds of computer systems,
  87. so non-ASCII characters should not be inserted verbatim into strings.
  88.  
  89. Symbols are sequences of characters that don't
  90. include any of the other special characters.  If you wish to include such
  91. characters in a symbol, enclose it in vertical bars,
  92. for example @code{|foo bar|}.
  93. (The bars are not part of the symbol.)
  94. Symbols are case-sensitive,
  95. but this will be changed eventually.
  96.  
  97. Lists are a sequence of expressions enclosed in parentheses.
  98. The empty list is either @code{nil} or @code{()}.
  99. ``Dotted pairs'' are not allowed.
  100. Anything that is not a list is an @dfn{atom}.
  101.  
  102. All of these objects may range up to a very large size.
  103. (You may still run into bugs if you make strings or symbols
  104. over about 100 chars in length.)
  105.  
  106. Comments are enclosed either within @code{#| |#} (which nests properly,
  107. like Common Lisp and unlike C), or else extend from a semicolon
  108. @code{;} to the end of the line.  A comment is equivalent to whitespace,
  109. so @code{(a#|bcd|#e)} is the same as @code{(a e)}, not @code{(ae)}.
  110.  
  111. @code{#} by itself is a normal token.
  112.  
  113. True/false values
  114. are just the integers 0 and 1, with no special characteristics.
  115.  
  116. @deffn GlobalConstant @code{true}
  117. @end deffn
  118. @deffn GlobalConstant @code{false}
  119. These constants are symbolic forms for @code{1} and @code{0}.
  120. They are identical to numbers,
  121. but more descriptive for parameters that are boolean-valued.
  122. @end deffn
  123.  
  124. Unit, material, and terrain types are distinct objects.
  125. However, they can be considered to have numeric ``indices''
  126. assigned in order of the types' definition.  These numbers
  127. are not directly visible in GDL, but they often affect sorting
  128. and ordering.
  129.  
  130. You may also supply numbers as ``dice specs'', which are used in several
  131. tables.  The syntax is the familiar @code{@var{nn}d@var{mm}[+@var{oo}]},
  132. where @var{nn} is the number of dice to throw, @var{mm} is the number of
  133. values on each die, and the optional @var{oo} is an value to be added to
  134. the result.  The die are 0-based, so for instance @code{3d6} yields values
  135. between 0 and 15, while @code{3d6+3} is equivalent to the result of rolling
  136. 3 6-sided dice.  The range of each value is severely limited; @var{nn}
  137. may range from 0 to 7, @var{mm} from 0 to 15, and @var{oo} from 0 to 127.
  138. Internally, dice specs are normal integers, in the range 16384 to 32767.
  139.  
  140. @node Conventions Used, Forms and Evaluation, Lexical Elements, Language Syntax
  141.  
  142. @subsection Conventions Used
  143.  
  144. Descriptions of values in this manual follow the conventions listed here.
  145.  
  146. For parameters described as @var{t/f},
  147. both @code{1}, @code{0} and @code{true}, @code{false} may be used.
  148. Parameters described as @var{n} and @var{n%} are numbers.
  149. Parameters described as @var{dist} or @var{length}
  150. are also numbers, but are in the unit of measure for lengths.
  151. Parameters described as @var{str} or @var{string} are strings.
  152.  
  153. Parameters described as
  154. @var{u} or @var{ui}, @var{m} or @var{mi}, and @var{t} or @var{ti},
  155. are values that must be unit, material, or terrain types, respectively.
  156.  
  157. Parameters described as @var{utype-value-list} match unit types with values.
  158. They can have several forms:
  159.  
  160. @itemize
  161. @item
  162. @code{(n1 n2 ...)} matches @code{n1} with type 0, etc in order.
  163. @item
  164. @code{((u1 n1) (u2 n2) ...)} evaluates @code{u1} to get a unit type,
  165. then matches it with @code{n1}.  @code{u1} etc may also be a list of
  166. types, in which case all the types get matched with @code{n1}.
  167. @end itemize
  168.  
  169. Other types of lists, such as those defined as @var{side-value-list},
  170. are interpreted similarly.  For all of these, multiple assignments to
  171. the same type etc will overwrite quietly.
  172.  
  173. @node Forms and Evaluation, Tables, Conventions Used, Language Syntax
  174.  
  175. @subsection Forms and Evaluation
  176.  
  177. A @dfn{form} is either any single expression that appears in the file.
  178. A GDL file consists of a sequence of forms.
  179. Most forms of interest will be lists
  180. whose first element is a symbol identifying the form.
  181. For instance, a form beginning with the symbol @code{side}
  182. declares a side object.
  183. When the file containing such a form is read, @i{Xconq} will
  184. create a side object and fill in any properties as specified by the form.
  185. (Properties are like properties or attributes - most GDL objects
  186. have some.)
  187.  
  188. In most contexts, @i{Xconq} will @dfn{evaluate} an expression
  189. before using it, such as when filling in an object's property.
  190. Numbers and strings evaluate to themselves, while symbols
  191. evaluate to their bindings, as set by @code{set} or @code{define}.
  192. Lists evaluate to a list of the same length, but with all the elements
  193. evaluated, unless the first element of the list is a function.
  194. In that case,
  195. the remaining elements of the list are evaluated and given to the
  196. function, and its result will be the result.
  197.  
  198. @node Tables, Modifying Objects, Forms and Evaluation, Language Syntax
  199.  
  200. @subsection Tables
  201.  
  202. A @dfn{table} is a two-dimensional array of values indexed by types.
  203. Indices can be any pair of unit, material, or terrain type.
  204. The set of tables is fixed by @i{Xconq}, and all are described below.
  205.  
  206. @deffn Form @code{table} table-name items@dots{}
  207. This is the general form to fill in a table.
  208. The table named by @var{table-name} is filled in from the @var{items}.
  209. If an item is an atom, then every position in the
  210. table is filled in with that item, overwriting any
  211. previously-specified values.
  212. If an item is a list, it must be a three-element list
  213. of the form @code{(@var{type1} @var{type2} @var{value})}.
  214. If both @var{type1} and @var{type2} are single types,
  215. then @var{value} will be put into the table at the position
  216. indexed by the two types.
  217. If one of @var{type1} or @var{type2} evaluates to a list,
  218. @i{Xconq} will iterate over all members of the list while
  219. keeping the other type constant,
  220. while if both @var{type1} and @var{type2} are lists,
  221. then @i{Xconq} will iterate over all pairs from the two lists.
  222. The values used during iteration depend on whether the @var{value}
  223. is a list.  If @var{value} is an atom, then that value will just
  224. be used on every iteration.  If a list, then @i{Xconq} will
  225. use successive elements of the list while iterating.
  226.  
  227. If the first member of @var{items} is the symbol @code{add},
  228. then the rest of the items will add to the existing contents
  229. of the table rather than clearing to its default value first.
  230. @end deffn
  231.  
  232. The following forms are all equivalent:
  233. @example
  234. (table foo (a y 1) (b y 2) (c y 3) (a z 9) (b z 9) (c z 9))
  235.  
  236. (table foo ((a b c) y (1 2 3)) ((a b c) (z) 9))
  237.  
  238. (define v1 (a b c))
  239. (table foo (v1 y (1 2 3)) (v1 z 9))
  240.  
  241. (table foo ((a b c) (y z) ((1 2 3) (9 9 9))))
  242.  
  243. (table foo (a y 1) (b y 2) (c y 3))
  244. (table foo add ((a b c) z 9))
  245. @end example
  246.  
  247. @node Modifying Objects, Symbols, Tables, Language Syntax
  248.  
  249. @subsection Modifying Objects
  250.  
  251. Since forms normally define or create new objects,
  252. GDL defines the @code{add} form to modify existing objects.
  253.  
  254. @deffn Form @code{add} objects property new-values@dots{}
  255. This form evaluates the atom or list @var{objects} to arrive at the
  256. set of objects to be modified.
  257. Then it uses the @var{new-values} to write new data into
  258. the property named @var{property} of those objects.
  259. The @var{new-values} may be a single number or string, or a list.
  260. @end deffn
  261.  
  262. @node Symbols, Lists, Modifying Objects, Language Syntax
  263.  
  264. @subsection Symbols
  265.  
  266. Most of the symbols used in a game module are the predefined ones
  267. described in this manual.
  268. Others are attached to types when the types are defined,
  269. and still others name objects like units and sides.
  270. You can also define and set your own symbols to arbitrary values.
  271.  
  272. @deffn Form @code{define} symbol value
  273. This form defines the symbol @var{symbol} to be bound to the
  274. result of evaluating @var{value}.
  275. If @var{symbol} is already defined, @i{Xconq} will issue a warning,
  276. and ignore this form.
  277. @end deffn
  278.  
  279. @deffn Form @code{set} symbol value
  280. This form rebinds the already-bound symbol @var{symbol}
  281. to be bound to the result of evaluating @var{value}.
  282. If @var{symbol} is @emph{not} bound already,
  283. then @i{Xconq} will issue a warning, but proceed anyway.
  284. @end deffn
  285.  
  286. @deffn Form @code{undefine} symbol
  287. This form destroys any binding of the @var{symbol}.
  288. This is allowed for any symbol, including already-unbound symbols.
  289. @end deffn
  290.  
  291. @node Lists,  , Symbols, Language Syntax
  292.  
  293. @subsection Lists
  294.  
  295. @deffn Function @code{quote} xxx@dots{}
  296. This function prevents any evaluation of @var{xxx}.
  297. (This implies that the abovementioned evaluation of the argument
  298. list does @i{not} happen for this ``function''.)
  299. @end deffn
  300.  
  301. @deffn Function @code{list} xxx@dots{}
  302. This function makes a list out of all the @var{xxx}.
  303. @end deffn
  304.  
  305. @deffn Function @code{append} xxx@dots{}
  306. This function appends all the @var{xxx} (which may be
  307. lists or not) into a single list.  Non-lists will appear
  308. as though they were single-element lists.
  309. @end deffn
  310.  
  311. @deffn Function @code{remove} list1 list2
  312. This function removes the members of @var{list1} from @var{list2},
  313. returning the result.
  314. @end deffn
  315.  
  316. @node Game Module Forms, World and Area Forms, Language Syntax, Reference Manual
  317.  
  318. @section Game Module Forms
  319.  
  320. The game module declaration supplies information about the file as a whole.
  321. It is optional; if missing, @i{Xconq} will get the module's
  322. name from its file name, and supply defaults for the other properties.
  323.  
  324. @deffn Form @code{game-module} [name] properties@dots{}
  325. This form defines the properties of this game module.
  326. The optional @var{name} is a string that will be used to look up
  327. the module in libraries.
  328. If the @var{name} is supplied, then this form is considered to be the
  329. definition of the module, and overwrites any
  330. @code{game-module} form previously appearing in this file.
  331. If @var{name} is missing, then this form will modify the
  332. existing description of the module.
  333. @end deffn
  334.  
  335. @deffn ModuleProperty @code{title} string
  336. If defined, this property is the name by which the module will be displayed to
  337. players.  It is not used internally, so the name can be modified freely
  338. (unlike the module's name, which may appear in other modules).
  339. Defaults to the module's name. 
  340. @end deffn
  341.  
  342. @deffn ModuleProperty @code{blurb} string
  343. This property is a one-line description that users will see when they
  344. are deciding whether to play the module.
  345. It will be displayed without any modification:
  346. @example
  347. Welcome to my nightmare! (version 1.0 with stronger goblins)
  348. @end example
  349. Defaults to @code{""}.
  350. @end deffn
  351.  
  352. @deffn ModuleProperty @code{picture-name} string
  353. This property is the name of a picture that may be displayed along
  354. with the module's blurb, by those interfaces that support such pictures.
  355. Defaults to @code{""}.
  356. @end deffn
  357.  
  358. @deffn ModuleProperty @code{base-game} t/f
  359. @end deffn
  360.  
  361. @deffn ModuleProperty @code{instructions} strings@dots{}
  362. This property is a list of strings that are the instructions on how to play
  363. the game.  Defaults to @code{()}.
  364. @end deffn
  365.  
  366. @deffn ModuleProperty @code{notes} strings@dots{}
  367. This property is a list of strings comprising the set of
  368. detailed player's notes for the module.
  369. Both the list and each string in the list can be of any length.
  370. When displayed, the strings are all concatenated together, so the division
  371. into strings here is just for convenience.
  372. How these are displayed is up to the interface, but in general an empty
  373. string signals a new paragraph.
  374. Defaults to @code{()}.
  375. @end deffn
  376.  
  377. @deffn ModuleProperty @code{design-notes} strings@dots{}
  378. This property is a list of strings that are notes addressed to game designers.
  379. Defaults to @code{()}.
  380. @end deffn
  381.  
  382. @deffn ModuleProperty @code{version} string
  383. This property is the version of the module.
  384. Defaults to @code{""},
  385. which indicates that the module's version is undefined.
  386. @end deffn
  387.  
  388. @deffn ModuleProperty @code{program-version} versions
  389. This property dentifies @i{Xconq} versions for which this module
  390. is appropriate.
  391. If specified, then players will get a warning if they attempt to use this
  392. module with an inappropriate version of @i{Xconq}.
  393. Possible forms include a string, which allows the module only for
  394. exactly matching version of @i{Xconq},
  395. and @code{(@var{comparison} @var{version})},
  396. which allows versions satisfying the @var{comparison} test,
  397. which may only be @code{>=} or @code{<=}.
  398. So for instance
  399. @example
  400. (game-module "foo" (program-version (>= "7.0.3")))
  401. @end example
  402. is claimed to only work for versions 7.0.3 or later.
  403. Defaults to @code{""}, which means that the module is appropriate for
  404. any version of @i{Xconq}.
  405.  
  406. Notes that the @code{program-version} is strictly a heuristic to forewarn
  407. players; in practice it can be very difficult to know which modules work
  408. with which programs.  (The problems are similar to those encountered
  409. by programmers using different compiler versions on their programs.)
  410. @end deffn
  411.  
  412. @deffn ModuleProperty @code{base-module} name
  413. This property is the name of a module that must be loaded first.
  414. It is similar in effect to @code{include}.
  415. @end deffn
  416.  
  417. @deffn ModuleProperty @code{default-base-module} name
  418. This property specifies the name of a module that will be loaded
  419. if this module is given as the ``top-level'' module,
  420. such as via @code{-g} on a command line.
  421.  
  422. This is to prevent disasters when a library module that is
  423. used only by other modules is instead loaded as if it were
  424. a full game design.
  425. @end deffn
  426.  
  427. @menu
  428. * Module Variants::                    
  429. * Including Other Modules::     
  430. * Conditional Loading::         
  431. @end menu
  432.  
  433. @node Module Variants, Including Other Modules, Game Module Forms, Game Module Forms
  434.  
  435. @subsection Module Variants
  436.  
  437. Variants are options chosen by players at the start of a game.
  438. A generic variant includes information that will be used for displaying
  439. the choice to players, the acceptable range of choices, a default
  440. choice, and additional forms that may be evaluated if particular
  441. values were chosen.  Variant values are always numbers.
  442.  
  443. @deffn ModuleProperty @code{variants} items@dots{}
  444. This property defines named variants on this module.
  445. Variants appear as startup options for the game.
  446. The items have the form
  447. @code{([@var{name}] @var{type} [@var{range/default}] [@var{clauses}])}.
  448. The @var{name} is a string or symbol used to identify the choice to
  449. the players, the @var{type} says what sort of change is being enabled,
  450. @var{range/default} supplies a range of values and a default value
  451. among them,
  452. and @var{clauses} is a list of the form @code{(@var{value} @var{forms}@dots{}}.
  453. A game module may specify any number of variants.
  454. Defaults to @code{()}.
  455. @end deffn
  456.  
  457. A number of commonly useful variant types are predefined.
  458.  
  459. @deffn VariantType @code{world-size} [ width [ height [ circumf [ lat [ lon ] ] ] ] ] [ clauses ]
  460. This variant allows players to choose the size of the world.
  461. The sizes will default to the values in this variant's data.
  462. (@var{width} and @var{height} can be lists of the form @code{(lo dflt hi)},
  463. with the obvious interpretation??)
  464. @end deffn
  465.  
  466. @deffn VariantType @code{world-seen} [ dflt ] [ clauses ]
  467. This variant allows players to choose whether
  468. the terrain of the world will be known at the start of the game.
  469. The default setting will be the value @code{dflt},
  470. which may be either @code{true} or @code{false}.
  471. @end deffn
  472.  
  473. @deffn VariantType @code{see-all} [ dflt ] [ clauses ]
  474. This variant allows players to choose whether everything will be seen
  475. always, as with the global variable @code{see-all}.
  476. The default is set by @code{dflt}.
  477. @end deffn
  478.  
  479. @deffn VariantType @code{sequential} [ dflt ] [ clauses ]
  480. This variant allows players to choose whether to move
  481. simultaneously during a turn, or one at a time.
  482. The default is set by @var{dflt}.
  483. @end deffn
  484.  
  485. @deffn VariantType @code{real-time} [ total [ perside [ perturn ] ] ] [ clauses ]
  486. This variant allows players to choose realtime limits on the game.
  487. The value will default to the values in this variant's data.
  488. @c but what about upper/lower limits?
  489. @end deffn
  490.  
  491. @node Including Other Modules, Conditional Loading, Module Variants, Game Module Forms
  492.  
  493. @subsection Including Other Modules
  494.  
  495. You can include one game module in another.
  496.  
  497. @deffn Form @code{include} [if-needed] module-name [variant-settings]
  498. This form has the effect of inserting the contents
  499. of @var{module-name} into the current position in the module.
  500. @code{game-module} forms in the included module are not inserted,
  501. although they are remembered and may appear in displays.
  502. @i{Xconq} will fail completely if the included module cannot be found.
  503.  
  504. Unlike C etc, the same module cannot be included more than once; you will
  505. get a warning and the module will not be loaded.
  506. @end deffn
  507.  
  508. Note that the module names are not file names,
  509. so that system-specific features like directories and devices
  510. cannot be included.
  511. The mapping between module name and file name is interface-specific,
  512. so if you want to distribute a module, you should make sure all the
  513. module names don't have anything nonportable embedded.
  514. Alphanumeric characters and hyphens are guaranteed to be portable.
  515.  
  516. @node Conditional Loading, , Including Other Modules, Game Module Forms
  517.  
  518. @subsection Conditional Loading
  519.  
  520. You can control which forms in a module are actually evaluated
  521. by using conditional loading.
  522.  
  523. @deffn Form @code{if} test-form sym
  524. @end deffn
  525. @deffn Form @code{else} sym
  526. @end deffn
  527. @deffn Form @code{end-if} sym
  528. If @var{test-form} evaluates to @code{true},
  529. then all subsequent forms, up until the matching @code{else}
  530. or @code{end-if}, will be evaluated.
  531. If @code{false}, then the forms will be read but not evaluated.
  532. All forms inside the conditional must be syntactically correct.
  533. @end deffn
  534.  
  535. @node World and Area Forms, Side and Player Forms, Game Module Forms, Reference Manual
  536.  
  537. @section World and Area Forms
  538.  
  539. The world consists of one @dfn{area},
  540. which is regular in shape and consists of a number of @dfn{cells}.
  541. Each cell has a type of terrain and a number of optional data values.
  542. Each kind of per-cell data will be called a @dfn{layer} of the area.
  543.  
  544. @deffn Form @code{world} [ circumference ] properties@dots{}
  545. This form defines the properties of the world as a whole.
  546. @end deffn
  547.  
  548. @deffn Form @code{area} [ width [ height ] ] [ restriction ] properties@dots{}
  549. This form defines the playing area of the world.
  550. The @var{restriction} identifies how to get data for this area from
  551. subsequent forms that are based on larger areas.
  552. @end deffn
  553.  
  554. @menu
  555. * World Properties::
  556. * Area Properties::
  557. * Layers::                      
  558. * Distances and Elevations::    
  559. * Temperatures::                
  560. * Winds::                       
  561. * Clouds::                      
  562. @end menu
  563.  
  564. @node World Properties, Area Properties, World and Area Forms, World and Area Forms
  565.  
  566. @subsection World Properties
  567.  
  568. @deffn WorldProperty @code{circumference} dist
  569. This property is the distance around the entire world (as a sphere).
  570. Default is @code{360}.
  571. @end deffn
  572.  
  573. @deffn WorldProperty @code{axial-tilt} n
  574. This property defines the extremes of seasonal changes.
  575. @end deffn
  576.  
  577. @node Area Properties, Layers, World Properties, World and Area Forms
  578.  
  579. @subsection Area Properties
  580.  
  581. @deffn AreaRestriction @code{restrict} w h x y
  582. This is a special subform that specifies that subsequent layers in an
  583. area of size w x h will be offset by x,y and then read into the
  584. actual area.  (This is useful for setting up a game that needs
  585. only a subset of a full map.)
  586.  
  587. Note that an area restriction is not a property, and must
  588. always appear before any properties in an area form.
  589. @end deffn
  590.  
  591. @deffn AreaProperty @code{width} n
  592. @end deffn
  593. @deffn AreaProperty @code{height} n
  594. These properties are the width and height of the world,
  595. as measured in cells.
  596. Allowable values range from 3x3
  597. up to 32767x32767, which is one billion cells!
  598. If only one of these is given, then the other defaults to the same value.
  599. If neither has been given, then they default to @code{60} and @code{30},
  600. respectively.
  601. @end deffn
  602.  
  603. In the case of a cylinder, the world wraps around
  604. in the x direction, and the width is the diameter of the cylinder,
  605. while the height is just the
  606. height in the usual sense.
  607. A hexagon world is flat on the top and bottom; its width is
  608. measured across the middle height, which is the largest span,
  609. and height is the same
  610. as for cylinders.  Here are some crude pictures, first of an 8x6 cylinder:
  611. @example
  612. # # # # # # # #
  613.  : : + + : : : :
  614. : : : + ^ : : :
  615.  : : : : : : : :
  616. : : : : ^ : : :
  617.  # # # # # # # #
  618. @end example
  619.  
  620. This world is an 8x7 hexagon:
  621. @example
  622.    # # # # # 
  623.   # : + + : #
  624.  # : : + ^ : #
  625. # : : + ^ : : #
  626.  # : : : : : #
  627.   # : : ^ : #
  628.    # # # # # 
  629. @end example
  630.  
  631. There are two kinds of properties that an area may have:
  632. scalar values such as latitude, 
  633. and layer values such as terrain and elevation.
  634.  
  635. @deffn AreaProperty @code{latitude} n
  636. This property is the offset, in cells, from the equator of the middle of the area
  637. (height / 2).
  638. Defaults to @code{0}.
  639. @end deffn
  640. @deffn AreaProperty @code{longitude} n
  641. This property is the offset, in cells, from the ``Greenwich Meridian''
  642. of the world.
  643. Defaults to @code{0}.
  644. @end deffn
  645.  
  646. @node Layers, Distances and Elevations, Area Properties, World and Area Forms
  647.  
  648. @subsection Layers
  649.  
  650. @dfn{Layers} constitute the bulk of data about an area of the world.
  651. Each layer assigns a value to each cell in the area;
  652. examples include cell terrain, temperatures, elevations, and so forth.
  653. Since there may be many cells in a layer with the same values,
  654. each layer uses a common run-length encoding scheme.
  655. In this scheme, each horizontal band of cells
  656. is a separate text string, and the contents of the string encode
  657. individual numeric values, one for each cell.
  658. The encoding uses the characters @code{a..~} and @code{:..[}
  659. for 0 through 63,
  660. and decimal digits followed by commas (or the end of the string)
  661. for all other numbers.
  662. An optional @code{-} is allowed, and indicates a negative value.
  663. Runs of constant value are prefixed with their length, in decimal.
  664. The character @code{*} separates run lengths from values expressed
  665. as digits.
  666. Thus, the string
  667. @example
  668. "40adaa100,2*-99"
  669. @end example
  670. represents 46 values in all: 40 zeroes, a three, 2 more zeros, a 100,
  671. and two -99s.
  672. Although this format is quite unreadable,
  673. it has the advantages of compactness and portability;
  674. the expectation is that most layer editing will be done on-line.
  675. Note that the run encoding is entirely optional.
  676.  
  677. The following subforms at the beginning of layer data have special effects:
  678.  
  679. @deffn LayerSubform @code{constant} n
  680. This subform causes every value in the layer to be set to @var{n}.
  681. @end deffn
  682.  
  683. @deffn LayerSubform @code{subarea} x y w h
  684. This subform indicates that the layer data should be positioned at the given
  685. rectangle in the layer.
  686. @end deffn
  687.  
  688. @deffn LayerSubform @code{xform} mul add
  689. This subform has the effect of first multiplying the raw value by @var{mul},
  690. then adding @var{add} and storing the result into the layer.
  691. @end deffn
  692.  
  693. @deffn LayerSubform @code{by-bits}
  694. @end deffn
  695.  
  696. @deffn LayerSubform @code{by-char} str
  697. This subform specifies that the characters in @var{str} give the
  698. encodings of values in the layer.
  699. The first character in @var{str} encodes 0, the second encodes 1,
  700. and so forth.
  701. @end deffn
  702.  
  703. @deffn LayerSubform @code{by-name} name-list
  704. [what is the syntax of name-list exactly?]
  705. This subform is for generic worlds that are useful across multiple game designs.
  706. The value/name pairs allow for the matching of terrain types by name,
  707. so that if, say,
  708. the ``sea'' terrain type was type #0 in one game and type #4 in another,
  709. the world would have sea in all the same places after it was read in.
  710. In practice, only a few worlds are this general.
  711. If a named terrain type is not present, @i{Xconq} will warn about it
  712. and substitute type 0.
  713. @end deffn
  714.  
  715. @deffn AreaProperty @code{terrain} layer-data@dots{}
  716. This property is the actual layer of terrain types for cells.
  717. @end deffn
  718.  
  719. @deffn AreaProperty @code{aux-terrain} terrain-type layer-data@dots{}
  720. This property fills in values for borders, connections, and coatings.
  721. For border and connection terrain,
  722. the value is a six-bit number (0..63),
  723. with a bit turned on in each direction that there is a border
  724. or connection.
  725. For coating types, the value is the depth of the coating.
  726. @end deffn
  727.  
  728. @deffn AreaProperty @code{features} feature-list layer-data@dots{}
  729. This property specifies the nature and location of all geographical features.
  730. The @var{feature-list} is a list of lists, where each sublist has the form
  731. @code{([@var{id}] @var{typename} @var{name} [@var{super}])}
  732. where @var{id} is the numerical id referenced in the layer data
  733. (defaults to feature's position in the @var{feature-list}),
  734. @var{typename} is a symbol or string giving the general type of feature
  735. (such as @code{bay}),
  736. @var{name} is the name of the feature
  737. (such as @code{"Bay of Bengal"}),
  738. and @var{super} is the optional id of another feature that
  739. incorporates this feature.
  740. @end deffn
  741.  
  742. @deffn AreaProperty @code{material} material-type layer-data@dots{}
  743. This property declares the quantity of the given @var{material-type}
  744. in each cell of the area.
  745. @end deffn
  746.  
  747. @deffn AreaProperty @code{people-sides} layer-data@dots{}
  748. This property says which side the people of each cell are on.
  749. A @var{side-encoding} of @code{exact} assigns 0 to independence (no side),
  750. 1 to the first side, and so forth; otherwise, the encoding is a list
  751. of side names/ids and numbers.
  752. @end deffn
  753.  
  754. @node Distances and Elevations, Temperatures, Layers, World and Area Forms
  755.  
  756. @subsection Distances and Elevations
  757.  
  758. @deffn AreaProperty @code{elevations} layer-data@dots{}
  759. This property is the world elevation data itself.
  760. If any elevation falls outside the min/max elevation range
  761. for the terrain type of the cell, then it
  762. will be truncated appropriately.
  763. Defaults to @code{0} for each cell.
  764. @end deffn
  765.  
  766. @deffn AreaProperty @code{cell-width} dist
  767. This property is the distance across a single cell,
  768. expressed as units of elevation.  Defaults to @code{1}.
  769. @end deffn
  770.  
  771. @node Temperatures, Winds, Distances and Elevations, World and Area Forms
  772.  
  773. @subsection Temperatures
  774.  
  775. Each type of terrain has a temperature range in which it may be found.
  776. Any calculation that would fall outside this range will be clipped.
  777.  
  778. The temperature can be set to have a given value at a given elevation.
  779. All air temperatures will be interpolated appropriately.
  780.  
  781. @deffn GlobalVariable @code{temperature-floor} n
  782. This variable is the lowest possible temperature.
  783. Defaults to @code{0}.
  784. @end deffn
  785.  
  786. @deffn GlobalVariable @code{temperature-floor-elevation} n
  787. This variable is the elevation at which the temperature is always at
  788. @code{temperature-floor}.
  789. Defaults to @code{0}.
  790. @end deffn
  791.  
  792. @deffn AreaProperty @code{temperatures} layer-data@dots{}
  793. This property contains the temperature data itself.
  794. If any temperature falls outside the min/max temperature range, then it
  795. will be truncated appropriately.
  796. Defaults to @code{0} for each cell.
  797. @end deffn
  798.  
  799. @node Winds, Clouds, Temperatures, World and Area Forms
  800.  
  801. @subsection Winds
  802.  
  803. Winds are defined as having a nonnegative force and a direction.
  804.  
  805. @deffn AreaProperty @code{winds} layer-data@dots{}
  806. This property contains the force and direction of the prevailing
  807. winds in each cell.
  808. @end deffn
  809.  
  810. @node Clouds,  , Winds, World and Area Forms
  811.  
  812. @subsection Clouds
  813.  
  814. Cloud cover is defined as a layer over the terrain, with
  815. a bottom and top and density for each cell.
  816.  
  817. @deffn AreaProperty @code{clouds} layer-data@dots{}
  818. This property is the degree of cloud cover over each cell.
  819. A value of @code{0} corresponds to clear skies.
  820. @end deffn
  821.  
  822. @deffn AreaProperty @code{cloud-bottoms} layer-data@dots{}
  823. This property is the altitude above the ground of the bottoms
  824. of the clouds.
  825. @end deffn
  826.  
  827. @deffn AreaProperty @code{cloud-heights} layer-data@dots{}
  828. This property is the vertical thickness of the cloud cover
  829. in each cell.
  830. @end deffn
  831.  
  832. @node Side and Player Forms, Unit Forms, World and Area Forms, Reference Manual
  833.  
  834. @section Side and Player Forms
  835.  
  836. @deffn Form @code{side} [id] properties@dots{}
  837. This form has the effect of declaring a side to exist.
  838. If the number or symbol @var{id} is supplied and
  839. matches that of a side that has already been created,
  840. then the properties will modify the pre-existing side.
  841. Otherwise a new side object will be created,
  842. with a arbitrarily-chosen numeric id ranging between 1 and @code{sides-max}.
  843. If the given @var{id} is a symbol, then the side's numeric id will be
  844. bound to that symbol.
  845. @end deffn
  846.  
  847. @deffn GlobalVariable @code{sides-min} n
  848. @end deffn
  849. @deffn GlobalVariable @code{sides-max} n
  850. These variables are the minimum and maximum number of sides that may exist in
  851. a game.  Defaults are to @code{1} and the internal parameter @code{MAXSIDES},
  852. which is usually around 7.
  853. @code{MAXSIDES} can only be changed by recompiling @i{Xconq}.
  854. @end deffn
  855.  
  856. @deffn Form @code{side-defaults} properties@dots{}
  857. This form sets the defaults for all newly-created sides declared
  858. subsequently.
  859. These defaults will be set before the new side's properties are interpreted.
  860. This form has no effect on existing sides or on side declarations that
  861. modify existing sides.
  862. @end deffn
  863.  
  864. @menu
  865. * Side Name Properties::  
  866. * Side Class::                  
  867. * Status in Game::              
  868. * Side Relationships::          
  869. * Numbering Units::             
  870. * Side-Specific Namers::        
  871. * Side Tech Levels::                 
  872. * Side Views::                       
  873. * Interaction::                 
  874. * Doctrine::                    
  875. * Other::                       
  876. * Players::
  877. * Rules of Side Configuration::
  878. @end menu
  879.  
  880. @node Side Name Properties, Side Class, Side and Player Forms, Side and Player Forms
  881.  
  882. @subsection Side Name Properties
  883.  
  884. If the game design allows, all of these properties can be set at startup by
  885. the players (see <side config> and below).
  886. Omission of some of these results in suppression or substitution,
  887. depending on the interface and the situation.
  888. Omission of all name properties allows the side to go unmentioned,
  889. which is useful when the concept of ``side'' is useless or
  890. confusing to a player (as in some adventure games).
  891. All of these properties may be set at any time by any player.
  892.  
  893. @deffn SideProperty @code{name} str
  894. This property is the proper name of a side, as a country or alliance name.
  895. Examples include @code{"Axis"} and @code{"Hyperborea"}.
  896. Defaults to @code{""}.
  897. @end deffn
  898.  
  899. @deffn SideProperty @code{long-name} str
  900. This property is the long form of a side's name,
  901. as in @code{"People's Republic of Hyperborea"}.
  902. Defaults to be the same as the side's name.
  903. @end deffn
  904.  
  905. @deffn SideProperty @code{short-name} str
  906. This property is an short name or acronym for the side,
  907. often just the letters of the long name, as in @code{"PRH"}.
  908. Defaults to @code{""}.
  909. @end deffn
  910.  
  911. @deffn SideProperty @code{noun} str
  912. This property is the name of an individual unit or person
  913. belonging to the side.
  914. Defaults to @code{""}, which suppresses any mention of the side
  915. when (textually) describing the individual.
  916. @end deffn
  917.  
  918. @deffn SideProperty @code{plural-noun} str
  919. This property is what you would call a group of individuals.
  920. Defaults to the most common plural form of the @code{noun}
  921. (in English, the default pluralizer adds an ``s''),
  922. so any alternative plural noun, such as @code{"Chinese"},
  923. will need an explicit @code{plural-noun} value.
  924. @end deffn
  925.  
  926. @deffn SideProperty @code{adjective} str
  927. This property is an adjective that can be used of individuals on the side,
  928. as in @code{"Spanish"}.
  929. Defaults to @code{""}, which suppresses use of the adjective.
  930. @end deffn
  931.  
  932. As a complete example, a side named @code{"Poland"} would have a long name
  933. @code{"Kingdom of Poland"}, short name @code{"Po"},
  934. noun @code{"Pole"}, plural noun @code{"Poles"},
  935. and adjective @code{"Polish"}.
  936.  
  937. @deffn SideProperty @code{color} str
  938. This property is a comma-separated list of colors that represents the side.
  939. Defaults to @code{"black"}.
  940. @end deffn
  941.  
  942. @deffn SideProperty @code{emblem-name} str
  943. This property is the name of a graphical icon that represents the side.
  944. An emblem name of @code{"none"} suppresses any emblem display for the side.
  945. Defaults to @code{""}, which gives the side a randomly-selected emblem.
  946. @end deffn
  947.  
  948. @deffn SideProperty @code{names-locked} t/f
  949. If the value of this property is @code{true},
  950. then the player cannot modify any of the side's names.
  951. Defaults to @code{false}.
  952. @end deffn
  953.  
  954. @node Side Class, Status in Game, Side Name Properties, Side and Player Forms
  955.  
  956. @subsection Side Class
  957.  
  958. @deffn SideProperty @code{class} str
  959. This property is a side's class, which is a keyword that characterizes the side.
  960. Any number of sides may be in the same class.
  961. Defaults to @code{""}.
  962. @end deffn
  963.  
  964. @node Status in Game, Side Relationships, Side Class, Side and Player Forms
  965.  
  966. @subsection Status in Game
  967.  
  968. Once a side is in the game, it can never be totally removed.
  969. However, sides can become inactive.
  970.  
  971. @deffn SideProperty @code{active} t/f
  972. This property is @code{true} if the side is still actively participating in the game.
  973. If the side has won, lost, or simply withdrew, this will be @code{false}.
  974. Any units on a side not in the game are effectively frozen statues;
  975. they don't do anything, and are untouchable by anyone else.
  976. Defaults to @code{true}.
  977. @end deffn
  978.  
  979. @deffn SideProperty @code{status} lose/draw/win
  980. This property tells how this side did in the game.  Defaults to @code{draw}.
  981. @end deffn
  982.  
  983. @deffn GlobalConstant @code{win}
  984. @end deffn
  985. @deffn GlobalConstant @code{draw}
  986. @end deffn
  987. @deffn GlobalConstant @code{lose}
  988. These constants are the different possible values for a side's status.
  989. @end deffn
  990.  
  991. @deffn SideProperty @code{advantage} n
  992. @end deffn
  993. @deffn SideProperty @code{advantage-min} n
  994. @end deffn
  995. @deffn SideProperty @code{advantage-max} n
  996. Initial and min/max limits on advantage for the side.
  997. All default to the values of the corresponding global variables.
  998. @end deffn
  999.  
  1000. @node Side Relationships, Numbering Units, Status in Game, Side and Player Forms
  1001.  
  1002. @subsection Side Relationships
  1003.  
  1004. By default, sides are neutral with respect to each other.
  1005.  
  1006. Control is a situation where one side
  1007. can observe and move another side's units, but not vice versa.
  1008. The controlling side can also just take the units of the controlled side.
  1009. If the controlled side loses or resigns, then the controlling side
  1010. automatically gets everything.
  1011. Both sides must agree to this relationship.
  1012.  
  1013. @deffn SideProperty @code{controlled-by} side
  1014. This property refers to the side controlling this one.
  1015. If 0, then the side is not under control.
  1016. Defaults to @code{0}.
  1017. @end deffn
  1018.  
  1019. The closest side relationship is one of trust.
  1020. A trusted side unit's may do anything at any time,
  1021. including entering and leaving units on the other side,
  1022. consuming the other side's materials, and so forth.
  1023.  
  1024. @deffn SideProperty @code{trusts} side-value-list
  1025. This property is true for any side that is trusted by this side.
  1026. Note that this relationship need not be symmetrical.
  1027. Defaults to @code{false} for all sides.
  1028. @end deffn
  1029.  
  1030. Note that these parameters apply only to relationships as enforced by
  1031. @i{Xconq}.  In an actual game, both human and robot sides can make agreements
  1032. and have positive/negative opinions about the other sides.
  1033.  
  1034. @deffn SideProperty @code{trades} side-value-list
  1035. This property defines the trading relationship with other sides.
  1036. Defaults to @code{0} for all sides.
  1037. @end deffn
  1038.  
  1039. @node Numbering Units, Side-Specific Namers, Side Relationships, Side and Player Forms
  1040.  
  1041. @subsection Numbering Units
  1042.  
  1043. @deffn SideProperty @code{next-numbers} utype-value-list
  1044. This property gives the next serial numbers that will be assigned to units
  1045. acquired by this side.
  1046. Defaults to @code{1} for each unit type (Dijkstra notwithstanding,
  1047. that's still where people start numbering things).
  1048. @end deffn
  1049.  
  1050. If the unit is of a type that gets numbered
  1051. (@code{assign-number} property is true),
  1052. then any unit of that type, acquired by any means whatsoever,
  1053. will be assigned the @code{next-numbers} value for that type
  1054. and @code{next-numbers} will be incremented.
  1055.  
  1056. @node Side-Specific Namers, Side Tech Levels, Numbering Units, Side and Player Forms
  1057.  
  1058. @subsection Side-Specific Namers
  1059.  
  1060. A side can have its own set of namers (see below)
  1061. that will be used for units
  1062. and geographical features associated with that side.
  1063.  
  1064. @deffn SideProperty @code{unit-namers} utype-value-list
  1065. This property specifies which namers will be used with which types
  1066. that the side starts out with or creates new units.
  1067. These will not be run automatically on captured units or gifts.
  1068. Defaults to @code{""} for each unit type.
  1069. @end deffn
  1070.  
  1071. @deffn SideProperty @code{feature-namers} feature-type-value-list
  1072. This property specifies which namers to use with which geographical
  1073. features in the side's initial country (if if has one).
  1074. Defaults to @code{()}.
  1075. @end deffn
  1076.  
  1077. @node Side Tech Levels, Side Views, Side-Specific Namers, Side and Player Forms
  1078.  
  1079. @subsection Side Tech Levels
  1080.  
  1081. The tech level of a side determines what it can do with each type of unit.
  1082.  
  1083. @deffn SideProperty @code{tech} utype-value-list
  1084. This property assigns a tech level to each unit type named.
  1085. Defaults to @code{0} for each unit type.
  1086. @end deffn
  1087.  
  1088. @deffn SideProperty @code{init-tech} utype-value-list
  1089. This property is the tech level at the beginning of the current turn.
  1090. Defaults to @code{0} for each unit type.
  1091. @end deffn
  1092.  
  1093. @node Side Views, Interaction, Side Tech Levels, Side and Player Forms
  1094.  
  1095. @subsection Side Views
  1096.  
  1097. These properties are necessary only if the relevant globals
  1098. are set a certain way (@code{see-all} is false, etc).
  1099.  
  1100. @deffn SideProperty @code{terrain-view} layer-data@dots{}
  1101. This property is the side's current knowledge of the world's terrain.
  1102. Defaults to @code{()}.
  1103. @end deffn
  1104.  
  1105. @deffn SideProperty @code{unit-view} layer-data@dots{}
  1106. This property is the side's current knowledge of the world.
  1107. Defaults to @code{()}.
  1108. @end deffn
  1109.  
  1110. @deffn SideProperty @code{unit-view-dates} layer-data@dots{}
  1111. This property is the turn number at which the unit view data
  1112. in the corresponding cell of the @code{unit-view} was set.
  1113. Defaults to @code{()}.
  1114. @end deffn
  1115.  
  1116. @node Interaction, Doctrine, Side Views, Side and Player Forms
  1117.  
  1118. @subsection Interaction
  1119.  
  1120. @deffn SideProperty @code{turn-time-used} seconds
  1121. This property is the number of (real) seconds
  1122. that this side has been moving units during the present turn.
  1123. Defaults to @code{0}.
  1124. @end deffn
  1125.  
  1126. @deffn SideProperty @code{total-time-used} seconds
  1127. This property is the number of (real) seconds that
  1128. this side has been moving units during the course of the game.
  1129. Defaults to @code{0}.
  1130. @end deffn
  1131.  
  1132. @deffn SideProperty @code{timeouts} n
  1133. This property is the number of ``time outs'' a side gets for the game.
  1134. Defaults to @code{0}.
  1135. @end deffn
  1136.  
  1137. @deffn SideProperty @code{timeouts-used} n
  1138. This property is the number of ``time outs'' a side has already used up.
  1139. Defaults to @code{0}.
  1140. @end deffn
  1141.  
  1142. @deffn SideProperty @code{finished-turn} t/f
  1143. This property is true if the side has declared that it is finished moving
  1144. things during this turn.
  1145. Defaults to @code{false}.
  1146. @end deffn
  1147.  
  1148. @deffn SideProperty @code{willing-to-draw} t/f
  1149. This property is true if the side will go along
  1150. with any other side that wants to end the game in a draw.
  1151. Defaults to @code{false}.
  1152. @end deffn
  1153.  
  1154. @node Doctrine, Other, Interaction, Side and Player Forms
  1155.  
  1156. @subsection Doctrine
  1157.  
  1158. Doctrines are objects that units consult to decide about individual behavior.
  1159.  
  1160. @deffn SideProperty @code{doctrines} utype-property-groups@dots{}
  1161. This property is the side's unit-type-specific doctrine.
  1162. Each @var{utype-property-group} has the form
  1163. @code{(@var{unit-types} doctrine)}.
  1164. Defaults to @code{()}.
  1165. @end deffn
  1166.  
  1167. @deffn SideProperty @code{doctrines-locked} t/f
  1168. This property says whether the docrine-unit type correspondence
  1169. for the side may be altered during the game.
  1170. This property does not control whether or not the properties
  1171. of the doctrines may be altered.
  1172. Defaults to @code{false}.
  1173. @end deffn
  1174.  
  1175. @deffn SideProperty @code{default-doctrine} doctrine-id
  1176. This property is the base doctrine that applies to all unit types
  1177. by default.
  1178. Defaults to @code{0}.
  1179. @end deffn
  1180.  
  1181. @deffn Form @code{doctrine} [id] properties@dots{}
  1182. This form creates a doctrine with the given id and properties.
  1183. @end deffn
  1184.  
  1185. @deffn DoctrineProperty @code{ever-ask-side} t/f
  1186. This property is the true if the unit may ask the player for what to do,
  1187. instead of picking some default activity.
  1188. @end deffn
  1189.  
  1190. @deffn DoctrineProperty @code{construction-run} type-value-list
  1191. This property is the default number of units to build when
  1192. construction has been requested.
  1193. @end deffn
  1194.  
  1195. @deffn DoctrineProperty @code{locked} t/f
  1196. This property is true if the properties of the doctrine
  1197. cannot be modified by the side's player during the game.
  1198. Defaults to @code{false}.
  1199. @end deffn
  1200.  
  1201. @node Other, Players, Doctrine, Side and Player Forms
  1202.  
  1203. @subsection Other
  1204.  
  1205. @deffn SideProperty @code{self-unit} unit
  1206. This property identifies a unit that represents the side itself.
  1207. The value may be a unit id, number, string, or symbol.
  1208. Defaults to @code{0}, which means that no unit represents the side.
  1209. See below for more details on self units.
  1210. @end deffn
  1211.  
  1212. @deffn SideProperty @code{priority} n
  1213. The order in which the side will get to act, relative to other sides
  1214. and to units.
  1215. Defaults to @code{0}.
  1216. @end deffn
  1217.  
  1218. @deffn SideProperty @code{scores} (skid val)@dots{}
  1219. This property is the current values of any numeric scores being
  1220. kept for the side.  It is a list of pairs of scorekeeper id and value.
  1221. Defaults to @code{()}.
  1222. @end deffn
  1223.  
  1224. @deffn Form @code{independent-units} properties@dots{}
  1225. Like the @code{side} form, but sets properties for independent units.
  1226. @end deffn
  1227.  
  1228. @deffn SideProperty @code{ui-data} data@dots{}
  1229. This property contains interface-specific data for the side.
  1230. This is mainly for preservation across game save/restores.
  1231. The property's value has the form
  1232. @code{((interface-type data) (interface-type data) ...)},
  1233. so that each interface can maintain its own data separately.
  1234. @end deffn
  1235.  
  1236. @deffn SideProperty @code{ai-data} data@dots{}
  1237. This property is information about the AIs associated with a side.
  1238. The property's value has the form
  1239. @code{((ai-type data) (ai-type data) ...)},
  1240. so that each type of AI can maintain its own data separately.
  1241. The form and meaning of each AI's data is specific to it alone.
  1242. Defaults to @code{()}.
  1243. @end deffn
  1244.  
  1245. @node Players, Rules of Side Configuration, Other, Side and Player Forms
  1246.  
  1247. @subsection Players
  1248.  
  1249. Player objects are rarely necessary when building game designs;
  1250. they typically only appear in saved games,
  1251. in order to ensure that the same players get the same sides
  1252. upon restoration.
  1253.  
  1254. @deffn SideProperty @code{player} id
  1255. This property is the unique identifier of a player that is running this side.
  1256. Defaults to @code{0}, which means that no player has been assigned
  1257. to the side.
  1258. @end deffn
  1259.  
  1260. @deffn Form @code{player} [id] properties@dots{}
  1261. This form defines a player.
  1262. If the @var{id} is supplied and matches the id of an existing player,
  1263. then the player object is updated using the @var{properties},
  1264. otherwise a new player object will be created,
  1265. using the given @var{id} if supplied, otherwise creating a new value.
  1266. @end deffn
  1267.  
  1268. @deffn GlobalVariable @code{player-sides-locked} t/f
  1269. This variable is @code{true} if the player/side assignment may not
  1270. be changed while the game is starting up.
  1271. Defaults to @code{false}.
  1272. @end deffn
  1273.  
  1274. The number of players must always be less than the number of sides
  1275. (sides without players just don't do anything).
  1276.  
  1277. @deffn PlayerProperty @code{name} str
  1278. This property identifies the player by name.
  1279. Defaults to @code{""}.
  1280. @end deffn
  1281.  
  1282. @deffn PlayerProperty @code{config-name} str
  1283. This property identifies a particular set of doctrine and other definitions
  1284. that the player is using.
  1285. Defaults to @code{""}.
  1286. @end deffn
  1287.  
  1288. @deffn PlayerProperty @code{display-name} str
  1289. This property identifies the display being used by the player's interface.
  1290. The interpretation of this value is dependent on the interface in use.
  1291. Defaults to @code{""}.
  1292. @end deffn
  1293.  
  1294. @deffn PlayerProperty @code{ai-type-name} str
  1295. This property is the type of AI that will play the side
  1296. if requested or necessary.
  1297. The set of choices depends on what has been compiled into @i{Xconq}.
  1298. (The general-purpose AI type @code{"mplayer"} will usually be available,
  1299. but is not guaranteed.)
  1300. An @code{ai-type-name} of @code{""} means that no AI will run this player.
  1301. Defaults to @code{""}.
  1302. @end deffn
  1303.  
  1304. @deffn PlayerProperty @code{password} str
  1305. This property is the encoding of a password that must be entered before this
  1306. player object can be reused successfully.
  1307. Defaults to @code{""}.
  1308. @end deffn
  1309.  
  1310. @deffn PlayerProperty @code{initial-advantage} n
  1311. This property is an initial relative strength at which the player should start.
  1312. Some synthesis methods can use this to give more units or some other
  1313. advantage to each player according to the requested strength.
  1314. Defaults to @code{1}.
  1315. @end deffn
  1316.  
  1317. @deffn GlobalVariable @code{advantage-min} n
  1318. @end deffn
  1319. @deffn GlobalVariable @code{advantage-max} n
  1320. @end deffn
  1321. @deffn GlobalVariable @code{advantage-default} n
  1322. These variables set the bounds and default values for players'
  1323. initial advantages.
  1324. Default to @code{1}, @code{9999}, and @code{1}, respectively.
  1325. @end deffn
  1326.  
  1327. @i{Xconq} is not guaranteed to be able to be able to set up a game
  1328. with any combination of player advantages;
  1329. the limits depend on the capabilities and characteristics of the
  1330. synthesis methods that use the requested advantages in their
  1331. calculations.
  1332.  
  1333. @node Rules of Side Configuration,  , Players , Side and Player Forms
  1334.  
  1335. @subsection Rules of Side Configuration
  1336.  
  1337. The properties of a side can come from a number of different sources
  1338. (here listed in order of precedence):
  1339.  
  1340. @itemize
  1341.  
  1342. @item
  1343. Interface-specific sources (X resources, Mac preferences).
  1344.  
  1345. @item
  1346. Game-specific form in player's configuration file.
  1347.  
  1348. @item
  1349. Generic form in player's configuration file.
  1350.  
  1351. @item
  1352. The @code{side} form for the side.
  1353.  
  1354. @item
  1355. The @code{side-defaults} form for the game.
  1356.  
  1357. @item
  1358. General program defaults.
  1359. @end itemize
  1360.  
  1361. Note that interface-specific and general config files can never alter
  1362. certain properties of a side, and can only alter others if they are
  1363. not locked.
  1364.  
  1365. @node Unit Forms, Agreements, Side and Player Forms, Reference Manual
  1366.  
  1367. @section Unit Forms
  1368.  
  1369. The basic @code{unit} form creates or modifies a unit.
  1370.  
  1371. @deffn Form @code{unit} id [ type ] properties@dots{}
  1372. This form defines a unit.
  1373. If a numeric @var{id} is supplied and matches the id of an existing unit,
  1374. then that unit will be modified by @var{properties},
  1375. and the optional @var{type} will be interpreted as a new type for the unit.
  1376. Otherwise a new unit will be created,
  1377. with either @var{id} as its id or
  1378. a arbitrarily-selected one if @var{id} is already in use.
  1379. If the unit's id is newly-generated and no type has been specified,
  1380. then type #0 (first-defined type) will be the type of the unit.
  1381. An id of @code{0} can never match an existing unit id, so effect
  1382. will be as if it had been omitted.
  1383. @end deffn
  1384.  
  1385. @deffn Form @var{unit-type-name} x y [ side-id ] properties@dots{}
  1386. This is an abbreviated form, in which
  1387. the x,y position is required, and an optional side id may be included.
  1388. The side id will come from @code{unit-defaults} if not specified.
  1389. The @var{unit-type-name} may be any valid unit type name or
  1390. defined name.
  1391. This form always results in a new unit.
  1392. @end deffn
  1393.  
  1394. Since there may be many units whose properties are similar, there
  1395. is a ``default unit'' whose properties fill in missing properties in
  1396. individual unit declarations.
  1397.  
  1398. @deffn Form @code{unit-defaults} [ modifier ] properties@dots{}
  1399. This form sets the default values for all subsequent units read in,
  1400. in this and every other module not yet loaded.
  1401. The set of defaults is additive,
  1402. so for instance you can repeatedly change the default side of units.
  1403. If the symbol @code{reset} has been supplied for the optional @var{modifier},
  1404. then all the defaults will be changed to the basic default
  1405. values, as described in this manual.
  1406. @end deffn
  1407.  
  1408. @deffn Symbol @code{reset}
  1409. This is the symbol used to reset unit defaults; see above.
  1410. @end deffn
  1411.  
  1412. @menu
  1413. * Unit Properties::             
  1414. * Unit Action State::           
  1415. * Unit Plan::                   
  1416. * Goal Types::                       
  1417. * Task Types::                  
  1418. @end menu
  1419.  
  1420. @node Unit Properties, Unit Action State, Unit Forms, Unit Forms
  1421.  
  1422. @subsection Unit Properties
  1423.  
  1424. This section lists properties of individual units.
  1425. In general, they default to the most common or reasonable values,
  1426. so need not always be specified, even in a saved game.
  1427.  
  1428. @deffn UnitProperty @code{@@} x y [ z ]
  1429. This property is the position of the unit.
  1430. Defaults to @code{-1,-1,0}, which causes the unit to be placed randomly.
  1431. The optional altitude @var{z} can also be set separately with
  1432. the property @code{z} below.
  1433. If @i{z} is even and the unit is in the open,
  1434. then the unit's altitude is @i{z/2};
  1435. if @i{z} is odd, then @i{(z-1)/2} is the type of connection terrain
  1436. that the unit is on.
  1437. @end deffn
  1438.  
  1439. @deffn UnitProperty @code{z} z
  1440. This property is identical to the optional z part of the @code{@@} property. 
  1441. Defaults to @code{0}.
  1442. @end deffn
  1443.  
  1444. @deffn UnitProperty @code{s} side
  1445. This property is the side of the unit.
  1446. It can be either a side name/noun/adjective (string) or id (number).
  1447. A value of @code{0} or @code{"independent"}
  1448. means that the unit is independent.
  1449. Defaults to @code{0}.
  1450. @end deffn
  1451.  
  1452. @deffn UnitProperty @code{os} side
  1453. This property is the original side of the unit.
  1454. It can be either a side name/noun/adjective (string) or id (number).
  1455. A value of @code{0} or @code{"independent"}
  1456. means that the unit is/was originally independent.
  1457. Defaults to the unit's actual side when first read in or created.
  1458. @end deffn
  1459.  
  1460. @deffn UnitProperty @code{#} n
  1461. This property is the unique numeric id of the unit.
  1462. Defaults to a game-selected value.
  1463. @end deffn
  1464.  
  1465. @deffn UnitProperty @code{n} str
  1466. This property is the name of the unit.
  1467. Defaults to @code{""}.
  1468. @end deffn
  1469.  
  1470. @deffn UnitProperty @code{nb} n
  1471. This property is the number of the unit,
  1472. which starts at @code{1} and goes up.
  1473. Defaults to @code{0}, which means that the unit is unnumbered.
  1474. @end deffn
  1475.  
  1476. @deffn UnitProperty @code{cp} n
  1477. This property is the current completeness of the unit.
  1478. If negative, indicates that the unit will appear at a time
  1479. and place specified by the @code{appear} x-property.
  1480. Defaults to the @code{cp-max} for the type.
  1481. @end deffn
  1482.  
  1483. @deffn UnitProperty @code{hp} n
  1484. This property is the current hit points of the unit.
  1485. Will be restricted to the range [0, hp-max].
  1486. An hp of 0 means that the unit is dead and will not appear in the game.
  1487. Defaults to @code{hp-max} for the unit's type.
  1488. @end deffn
  1489.  
  1490. @deffn UnitProperty @code{cxp} cxp
  1491. This property is the combat experience of the unit.
  1492. Defaults to @code{0}.
  1493. @end deffn
  1494.  
  1495. @deffn UnitProperty @code{mo} n
  1496. This property is the morale of the unit.
  1497. Defaults to @code{0}.
  1498. @end deffn
  1499.  
  1500. @deffn UnitProperty @code{m} mtype-value-list
  1501. This property is the amounts of supplies being carried by the unit.
  1502. Defaults to @code{0} for each material type.
  1503. @end deffn
  1504.  
  1505. @deffn UnitProperty @code{tp} utype-value-list
  1506. This property is the level of tooling to build each type of unit.
  1507. Defaults to @code{0} for each unit type.
  1508. @end deffn
  1509.  
  1510. @deffn UnitProperty @code{in} n
  1511. This property is the id of the unit's transport.
  1512. Defaults to @code{0}, meaning that unit is not in any transport.
  1513. @end deffn
  1514.  
  1515. @deffn UnitProperty @code{opinions} side-value-list@dots{}
  1516. This property is the unit's true feelings towards each side,
  1517. including its own side.
  1518. Defaults to @code{0} for each side.
  1519. @end deffn
  1520.  
  1521. @deffn UnitProperty @code{x} obj
  1522. This property is the optional extension properties of the unit.
  1523. Its value may be any object.
  1524. Defaults to @code{()}.
  1525. @end deffn
  1526.  
  1527. @deffn Symbol @code{appear}
  1528. @end deffn
  1529. @deffn Symbol @code{disappear}
  1530. These are extension properties that indicate
  1531. when and where a unit will appear in the game,
  1532. and when it will disappear.
  1533. [syntax?]
  1534. @end deffn
  1535.  
  1536. @node Unit Action State, Unit Plan, Unit Properties, Unit Forms
  1537.  
  1538. @subsection Unit Action State
  1539.  
  1540. @deffn UnitProperty @code{act} subprops
  1541. This property specifies the current action state of the unit.
  1542. @end deffn
  1543.  
  1544. @deffn UnitActionStateProperty @code{acp} n
  1545. This property is the number of action points left to the unit for this turn.
  1546. Defaults to @code{0}.
  1547. @end deffn
  1548.  
  1549. @deffn UnitActionStateProperty @code{acp0} n
  1550. This property is the initial number of action points for this turn,
  1551. computed at the beginning of the turn.
  1552. Defaults to @code{0}.
  1553. @end deffn
  1554.  
  1555. @deffn UnitActionStateProperty @code{aa} n
  1556. This property is the actual number of actions executed by the
  1557. unit so far in the current turn.
  1558. Defaults to @code{0}.
  1559. @end deffn
  1560.  
  1561. @deffn UnitActionStateProperty @code{am} n
  1562. This property is the actual number of moves (cell entries)
  1563. executed so far in the current turn.
  1564. Defaults to @code{0}.
  1565. @end deffn
  1566.  
  1567. @deffn UnitActionStateProperty @code{a} action
  1568. This property is the next action that the unit will perform.
  1569. @end deffn
  1570.  
  1571. Note that if any unit-defining form has an @code{act} property,
  1572. @i{Xconq} will start at an appropriate point in the middle of a turn,
  1573. giving all other units zero acp and mp,
  1574. rather than starting at the beginning of the turn
  1575. and computing acp and mp for all units.
  1576.  
  1577. @node Unit Plan, Goal Types, Unit Action State, Unit Forms
  1578.  
  1579. @subsection Unit Plan
  1580.  
  1581. @deffn UnitProperty @code{plan} type [creation-turn] properties@dots{}
  1582. This property describes the unit's current plan.
  1583. @end deffn
  1584.  
  1585. @deffn PlanType @code{none}
  1586. A unit with this type of plan does nothing.
  1587. It is used when a side has no player.
  1588. @end deffn
  1589.  
  1590. @deffn PlanType @code{passive}
  1591. This plan type is for units on a side that is being run directly
  1592. by the side.
  1593. @end deffn
  1594.  
  1595. @deffn PlanType @code{defensive}
  1596. This plan type is for units that defend areas or other units.
  1597. @end deffn
  1598.  
  1599. @deffn PlanType @code{offensive}
  1600. This plan type is for units that are to be aggressive.
  1601. @end deffn
  1602.  
  1603. @deffn PlanType @code{exploratory}
  1604. This plan type is for units that explore the world.
  1605. @end deffn
  1606.  
  1607. @deffn PlanType @code{random}
  1608. A unit with this plan type will act randomly.
  1609. @end deffn
  1610.  
  1611. @deffn PlanProperty @code{goal} goal
  1612. This property is the main goal of a unit's plan.
  1613. Defaults to @code{()}.
  1614. @end deffn
  1615.  
  1616. @deffn PlanProperty @code{formation} goal
  1617. This property is the formation goal of a unit's plan.
  1618. If defined, it is a position goal that the unit should
  1619. try to achieve when it is not trying to achieve the main goal.
  1620. Defaults to @code{()}.
  1621. @end deffn
  1622.  
  1623. [also support some kind of hook for specific AIs?]
  1624.  
  1625. @deffn PlanProperty @code{tasks} tasks@dots{}
  1626. This property is the complete task agenda for the unit's plan.
  1627. It is a list of tasks.
  1628. Defaults to @code{()}.
  1629. @end deffn
  1630.  
  1631. @deffn PlanProperty @code{asleep} t/f
  1632. This property is true if the unit is asleep.
  1633. Defaults to @code{false}.
  1634. @end deffn
  1635.  
  1636. @deffn PlanProperty @code{reserve} t/f
  1637. This property is true if the unit is in reserve.
  1638. Defaults to @code{false}.
  1639. @end deffn
  1640.  
  1641. @deffn PlanProperty @code{delayed} t/f
  1642. This property is true if the unit's activity
  1643. has been delayed until all others have acted.
  1644. Defaults to @code{false}.
  1645. @end deffn
  1646.  
  1647. @deffn PlanProperty @code{wait} t/f
  1648. This property is true if the unit is waiting for orders.
  1649. Defaults to @code{false}.
  1650. @end deffn
  1651.  
  1652. @deffn PlanProperty @code{ai-control} t/f
  1653. This property is true if the unit can be controlled by
  1654. any AI associated with the side.
  1655. Defaults to @code{true}.
  1656. @end deffn
  1657.  
  1658. @deffn PlanProperty @code{supply-alarm} t/f
  1659. This property is true if the unit should react when supply
  1660. is low.
  1661. Defaults to @code{false}.
  1662. @end deffn
  1663.  
  1664. @deffn PlanProperty @code{supply-is-low} t/f
  1665. This property is true if the unit considers its supply
  1666. to be low.
  1667. Defaults to @code{false}.
  1668. @end deffn
  1669.  
  1670. @deffn PlanProperty @code{wait-transport} t/f
  1671. This property is true if the unit is waiting for transport.
  1672. Defaults to @code{false}.
  1673. @end deffn
  1674.  
  1675. @deffn PlanProperty @code{initial-turn} turn
  1676. This property is the turn upon which a plan should go into effect.
  1677. Defaults to @code{0}.
  1678. @end deffn
  1679.  
  1680. @deffn PlanProperty @code{final-turn} turn
  1681. This property is the turn upon which a plan should be removed.
  1682. If the value is @code{0}, then the plan is not scheduled to
  1683. be removed.
  1684. Defaults to @code{0}.
  1685. @end deffn
  1686.  
  1687. @node Goal Types, Task Types, Unit Plan, Unit Forms
  1688.  
  1689. @subsection Goal Types
  1690.  
  1691. The possible types of goals are these:
  1692.  
  1693. @deffn GoalType @code{no-goal}
  1694. @end deffn
  1695.  
  1696. @deffn GoalType @code{won-game}
  1697. @end deffn
  1698.  
  1699. @deffn GoalType @code{lost-game}
  1700. @end deffn
  1701.  
  1702. @deffn GoalType @code{world-is-known}
  1703. @end deffn
  1704.  
  1705. @deffn GoalType @code{vicinity-is-known}
  1706. @end deffn
  1707.  
  1708. @deffn GoalType @code{positions-known}
  1709. @end deffn
  1710.  
  1711. @deffn GoalType @code{cell-is-occupied}
  1712. @end deffn
  1713.  
  1714. @deffn GoalType @code{vicinity-is-held}
  1715. @end deffn
  1716.  
  1717. @deffn GoalType @code{has-unit-type}
  1718. @end deffn
  1719.  
  1720. @deffn GoalType @code{has-unit-type-near}
  1721. @end deffn
  1722.  
  1723. @deffn GoalType @code{has-material-type}
  1724. @end deffn
  1725.  
  1726. @deffn GoalType @code{keep-formation}
  1727. @end deffn
  1728.  
  1729. @node Task Types,  , Goal Types, Unit Forms
  1730.  
  1731. @subsection Task Types
  1732.  
  1733. The possible types of tasks are these:
  1734.  
  1735. @deffn TaskType @code{build} u n n2 unit-id
  1736. This type of task directs the unit to build @var{n} units
  1737. of type @var{u}.  @var{n2} is the number already built
  1738. in the run and @var{unit-id} is the (optional) id of a
  1739. unit already being built.
  1740. @end deffn
  1741.  
  1742. @deffn TaskType @code{capture} unit-id
  1743. @end deffn
  1744.  
  1745. @deffn TaskType @code{disband}
  1746. This type of task directs the unit to disband itself.
  1747. @end deffn
  1748.  
  1749. @deffn TaskType @code{do-action} n action
  1750. @end deffn
  1751.  
  1752. @deffn TaskType @code{hit-position} x y z
  1753. @end deffn
  1754.  
  1755. @deffn TaskType @code{hit-unit} unit-id
  1756. @end deffn
  1757.  
  1758. @deffn TaskType @code{move-dir} dir
  1759. @end deffn
  1760.  
  1761. @deffn TaskType @code{move-to} x y z dist
  1762. This type of task directs the unit to move to a distance of
  1763. no more than @code{dist} cells from the given location.
  1764. @end deffn
  1765.  
  1766. @deffn TaskType @code{occupy} unit
  1767. @end deffn
  1768.  
  1769. @deffn TaskType @code{pickup} unit
  1770. @end deffn
  1771.  
  1772. @deffn TaskType @code{repair} unit
  1773. @end deffn
  1774.  
  1775. @deffn TaskType @code{resupply}
  1776. @end deffn
  1777.  
  1778. @deffn TaskType @code{sentry} n
  1779. This task type directs the unit to stay where it is for
  1780. the next @var{n} turns.
  1781. @end deffn
  1782.  
  1783. @node Agreements, Scorekeeper Forms, Unit Forms, Reference Manual
  1784.  
  1785. @section Agreements
  1786.  
  1787. @deffn Form @code{agreement} [name/id] properties@dots{}
  1788. This form defines an agreement among a set of sides.
  1789. The name/id is a unique internal identifier.
  1790. @end deffn
  1791.  
  1792. @deffn AgreementProperty @code{type-name} str
  1793. This property is the name of the general type of agreement,
  1794. such a trade.
  1795. Defaults to @code{""}.
  1796. @end deffn
  1797.  
  1798. @deffn AgreementProperty @code{title} str
  1799. This property is the player-visible name of the agreement.
  1800. Defaults to @code{""}.
  1801. @end deffn
  1802.  
  1803. @deffn AgreementProperty @code{terms} forms@dots{}
  1804. This property is the list of terms of the agreement.
  1805. Defaults to @code{()}.
  1806. @end deffn
  1807.  
  1808. @deffn AgreementProperty @code{drafters} side-list
  1809. This property is the side that initially proposed the agreement.
  1810. @end deffn
  1811.  
  1812. @deffn AgreementProperty @code{proposers} side-list
  1813. This property is the side that initially proposed the agreement.
  1814. @end deffn
  1815.  
  1816. @deffn AgreementProperty @code{signers} side-list
  1817. Before the agreement is made,
  1818. this property is the proposed list of participants.
  1819. After the agreeement is made,
  1820. this is the actual list of participants.
  1821. @end deffn
  1822.  
  1823. @deffn AgreementProperty @code{willing-to-sign} side-list
  1824. This property is all the sides that have already agreed to this agreement,
  1825. on condition that all the other sides accept it.
  1826. @end deffn
  1827.  
  1828. @deffn AgreementProperty @code{known-to} side-list
  1829. @end deffn
  1830.  
  1831. @deffn AgreementProperty @code{enforcement} form
  1832. @end deffn
  1833.  
  1834. [include values such as @code{enforced} and @code{publicity}?]
  1835.  
  1836. @deffn AgreementProperty @code{state} state
  1837. @end deffn
  1838.  
  1839. [add symbols for states]
  1840.  
  1841. @node Scorekeeper Forms, History Forms, Agreements, Reference Manual
  1842.  
  1843. @section Scorekeeper Forms
  1844.  
  1845. Scorekeepers are the objects that manage scoring, winning, and losing.
  1846. A game design need not define any scorekeepers,
  1847. and none are created by default.
  1848. A scorekeeper may either maintain a numeric score that is used at
  1849. the end of the game to decide rankings, or simply declare a side
  1850. to have won or lost.
  1851.  
  1852. @deffn Form @code{scorekeeper} name properties@dots{}
  1853. This form creates or modifies a scorekeeper with the given @var{name},
  1854. with the given @var{properties}.
  1855. @end deffn
  1856.  
  1857. @menu
  1858. * Scorekeeper Properties::
  1859. * Scorekeeper Bodies::                      
  1860. * Scorekeeper Functions::       
  1861. * Scorefile::                   
  1862. @end menu
  1863.  
  1864. @node Scorekeeper Properties, Scorekeeper Bodies, , Scorekeeper Forms
  1865.  
  1866. @subsection Scorekeeper Properties
  1867.  
  1868. @deffn ScorekeeperProperty @code{title} str
  1869. This property is a string that identifies the scorekeeper to the players.
  1870. Defaults to @code{""}.
  1871. @end deffn
  1872.  
  1873. @deffn ScorekeeperProperty @code{when} (type [exp])
  1874. This property is when the scorekeeper will be checked or updated.
  1875. Defaults to @code{after-turn}.
  1876. @end deffn
  1877.  
  1878. @deffn ScorekeeperWhenType @code{before-turn} exp
  1879. This indicates that the scorekeeper will run at the start of each turn
  1880. matching @var{exp}, or after every turn if @var{exp} is not given.
  1881. @end deffn
  1882.  
  1883. @deffn ScorekeeperWhenType @code{after-turn} exp
  1884. This indicates that the scorekeeper will run at the end of each turn
  1885. matching @var{exp}, or after every turn if @var{exp} is not given.
  1886. @end deffn
  1887.  
  1888. @deffn ScorekeeperWhenType @code{after-event} exp
  1889. This indicates that the scorekeeper will run after every event
  1890. matching @var{exp}, or after every event if @var{exp} is not given.
  1891. @end deffn
  1892.  
  1893. @deffn ScorekeeperWhenType @code{after-action} exp
  1894. This indicates that the scorekeeper will run at the end of each action
  1895. matching @var{exp}, or after every action if @var{exp} is not given.
  1896. @end deffn
  1897.  
  1898. @deffn ScorekeeperProperty @code{applies-to} side-list
  1899. This property is the set of sides or side classes
  1900. to which the scorekeeper applies.
  1901. Scorekeepers apply only to sides that are in the game.
  1902. Defaults to @code{side*}. 
  1903. @end deffn
  1904.  
  1905. @deffn ScorekeeperProperty @code{known-to} side-list
  1906. This property is the list of sides that know about this scorekeeper,
  1907. and can see the value of the score for each side that it applies to.
  1908. Defaults to @code{side*}. 
  1909. @end deffn
  1910.  
  1911. @deffn ScorekeeperProperty @code{trigger} form
  1912. This property is an expression that is true when it is time
  1913. to start checking the scorekeeper's main test.
  1914. Once a scorekeeper is triggered, it remains active.
  1915. Defaults to @code{false}.
  1916. @end deffn
  1917.  
  1918. @deffn ScorekeeperProperty @code{triggered} t/f
  1919. This property is true if the scorekeeper is currently triggered.
  1920. Defaults to @code{true}.
  1921. @end deffn
  1922.  
  1923. @deffn ScorekeeperProperty @code{do} forms@dots{}
  1924. This property is a list of forms to execute in order
  1925. each time the scorekeeper runs.
  1926. Defaults to @code{()}.
  1927. @end deffn
  1928.  
  1929. @deffn ScorekeeperProperty @code{messages} forms@dots{}
  1930. This property is a list of messages to be sent [???].
  1931. Defaults to @code{()}.
  1932. @end deffn
  1933.  
  1934. @deffn ScorekeeperProperty @code{initial} value
  1935. This property is the value of the score upon game startup.
  1936. If this value is @code{-9999},
  1937. the scorekeeper does not maintain a numeric score.
  1938. Defaults to @code{-9999}.
  1939. @end deffn
  1940.  
  1941. @node Scorekeeper Bodies, Scorekeeper Functions, Scorekeeper Properties, Scorekeeper Forms
  1942.  
  1943. @subsection Scorekeeper Bodies
  1944.  
  1945. The forms in the body (the @code{do} property) of the scorekeeper
  1946. may be any of the forms listed here.
  1947.  
  1948. @deffn ScorekeeperForm @code{last-side-wins}
  1949. If supplied as the only symbol in the body, then the scorekeeper
  1950. implements the usual ``last side left in the game wins'' behavior.
  1951. @end deffn
  1952.  
  1953. @deffn ScorekeeperForm @code{if} test action
  1954. If the @i{test} evaluates to @code{true} or any nonzero number,
  1955. then the @i{action} will be done.
  1956. @end deffn
  1957.  
  1958. @deffn ScorekeeperForm @code{cond} (test actions@dots{}) @dots{}
  1959. This is like Lisp's cond.
  1960. @end deffn
  1961.  
  1962. @deffn ScorekeeperForm @code{stop} [message]
  1963. This stops the game immediately, with a draw for all sides.
  1964. @end deffn
  1965.  
  1966. @deffn ScorekeeperForm @code{win} [sides] [own-message] [other-message]
  1967. @end deffn
  1968.  
  1969. @deffn ScorekeeperForm @code{lose} [sides] [own-message] [other-message]
  1970. @end deffn
  1971.  
  1972. @deffn ScorekeeperForm @code{end} [message]
  1973. This scorekeeper action ends the game immediately.
  1974. @end deffn
  1975.  
  1976. @deffn ScorekeeperForm @code{add} exp [side]
  1977. This adds the result of evaluating @var{exp} to the score of the given side.
  1978. The value may be a negative number.
  1979. @end deffn
  1980.  
  1981. @node Scorekeeper Functions, Scorefile, Scorekeeper Bodies, Scorekeeper Forms
  1982.  
  1983. @subsection Scorekeeper Functions
  1984.  
  1985. @deffn ScorekeeperFunction @code{and} exps
  1986. @end deffn
  1987.  
  1988. @deffn ScorekeeperFunction @code{or} exps
  1989. @end deffn
  1990.  
  1991. @deffn ScorekeeperFunction @code{not} exp
  1992. @end deffn
  1993.  
  1994. @deffn ScorekeeperFunction @code{=} exp1 exp2
  1995. @end deffn
  1996.  
  1997. @deffn ScorekeeperFunction @code{/=} exp1 exp2
  1998. @end deffn
  1999.  
  2000. @deffn ScorekeeperFunction @code{>} exp1 exp2
  2001. @end deffn
  2002.  
  2003. @deffn ScorekeeperFunction @code{>=} exp1 exp2
  2004. @end deffn
  2005.  
  2006. @deffn ScorekeeperFunction @code{<} exp1 exp2
  2007. @end deffn
  2008.  
  2009. @deffn ScorekeeperFunction @code{<=} exp1 exp2
  2010. @end deffn
  2011.  
  2012. @deffn ScorekeeperFunction @code{sum} types properties [test]
  2013. @end deffn
  2014.  
  2015. @node Scorefile,  , Scorekeeper Functions, Scorekeeper Forms
  2016.  
  2017. @subsection Scorefile
  2018.  
  2019. @deffn GlobalVariable @code{scorefile-name} str
  2020. This variable supplies the name of the file to be used for recording
  2021. scores of people playing the game.
  2022. The default value is @code{""}, which disables the recording of scores.
  2023. @end deffn
  2024.  
  2025. @c [scorefile must include xconq version, module(s) plus versions,
  2026. @c player/side setup, dates/times, and list of scores/values plus
  2027. @c optional id as to which is which]
  2028.  
  2029. @node History Forms, Battle Forms, Scorekeeper Forms, Reference Manual
  2030.  
  2031. @section History Forms
  2032.  
  2033. All the important events in a game are logged into a history.
  2034.  
  2035. @deffn Form @code{evt} date type sides data
  2036. This form creates a single historical event.
  2037. The @var{date} is the turn of the event's occurrence, while
  2038. the @var{sides} is a bit mask of sides that know about the
  2039. event, or @code{all} if all sides know about it.
  2040. @end deffn
  2041.  
  2042. @deffn GlobalConstant @code{all}
  2043. @end deffn
  2044.  
  2045. @deffn Form @code{exu} id type x y side props
  2046. This form defines an ``ex-unit'', which is a record of a unit that
  2047. existed previously.  It is similar to a unit, but has only a few
  2048. properties; type, id, position, side, name, and number.
  2049. Property names and semantics are nearly identical to their
  2050. counterparts for units.
  2051. @end deffn
  2052.  
  2053. @deffn EventType @code{log-started}
  2054. This event records when the recording of events began.
  2055. Multiple instances of this may occur, for instance if
  2056. logging were to be turned off and then on again.
  2057. @end deffn
  2058.  
  2059. @deffn EventType @code{log-ended}
  2060. @end deffn
  2061.  
  2062. @deffn EventType @code{game-started}
  2063. This event records the actual start of the game.
  2064. There should only be one in a game's history.
  2065. @end deffn
  2066.  
  2067. @deffn EventType @code{game-saved}
  2068. This event records that the game was saved.
  2069. @end deffn
  2070.  
  2071. @deffn EventType @code{game-restarted}
  2072. This event records that the game was restored and restarted from
  2073. a saved game.
  2074. @end deffn
  2075.  
  2076. @deffn EventType @code{game-ended}
  2077. @end deffn
  2078.  
  2079. @deffn EventType @code{side-joined} side
  2080. This event records when a side joined the game.
  2081. @end deffn
  2082.  
  2083. @deffn EventType @code{side-lost} side scorekeeper
  2084. This event records when a side lost.
  2085. @end deffn
  2086.  
  2087. @deffn EventType @code{side-won} side scorekeeper
  2088. This event records when a side won.
  2089. @end deffn
  2090.  
  2091. @deffn EventType @code{side-withdrew} side
  2092. This event records when a side withdrew from the game.
  2093. @end deffn
  2094.  
  2095. @deffn EventType @code{unit-created} side unit
  2096. This event records the creation of a unit.
  2097. @end deffn
  2098.  
  2099. @deffn EventType @code{unit-completed} side unit
  2100. This event records the completion of a unit.
  2101. @end deffn
  2102.  
  2103. @deffn EventType @code{unit-acquired}
  2104. This event records the acquisition of a unit,
  2105. for instance as a gift from another side.
  2106. @end deffn
  2107.  
  2108. @deffn EventType @code{unit-captured}
  2109. This event records the capture of a unit,
  2110. as an outcome of combat or from a direct attempt to capture.
  2111. @end deffn
  2112.  
  2113. @deffn EventType @code{unit-moved} unit x1 y1 x2 y2
  2114. This event records the movement of a unit.
  2115. @end deffn
  2116.  
  2117. @deffn EventType @code{unit-name-changed} unit1 unit2
  2118. This event records that a unit's name was changed.
  2119. @var{unit1} will be an ex-unit representing the unit
  2120. under its previous name.
  2121. @end deffn
  2122.  
  2123. @deffn EventType @code{unit-type-changed} unit1 unit2
  2124. This event records that a unit's type was changed.
  2125. @var{unit1} will be an ex-unit representing the unit
  2126. with its previous type.
  2127. @end deffn
  2128.  
  2129. @deffn EventType @code{unit-assaulted} unit1 unit2 x y
  2130. @end deffn
  2131.  
  2132. @deffn EventType @code{unit-damaged} unit hp1 hp2
  2133. @end deffn
  2134.  
  2135. @deffn EventType @code{unit-killed} unit
  2136. @end deffn
  2137.  
  2138. @deffn EventType @code{unit-vanished} unit
  2139. @end deffn
  2140.  
  2141. @deffn EventType @code{unit-wrecked} unit
  2142. @end deffn
  2143.  
  2144. @deffn EventType @code{unit-garrisoned} unit
  2145. @end deffn
  2146.  
  2147. @deffn EventType @code{unit-disbanded} unit
  2148. @end deffn
  2149.  
  2150. @deffn EventType @code{unit-starved} unit
  2151. @end deffn
  2152.  
  2153. @deffn EventType @code{unit-left-world} unit
  2154. @end deffn
  2155.  
  2156. The following event types are the results of actions.
  2157.  
  2158. @deffn EventType @code{action-ok}
  2159. @end deffn
  2160.  
  2161. @deffn EventType @code{action-error}
  2162. @end deffn
  2163.  
  2164. @deffn EventType @code{cannot-do}
  2165. @end deffn
  2166.  
  2167. @deffn EventType @code{insufficient-acp}
  2168. @end deffn
  2169.  
  2170. @deffn EventType @code{insufficient-material}
  2171. @end deffn
  2172.  
  2173. @deffn EventType @code{too-far}
  2174. @end deffn
  2175.  
  2176. @deffn EventType @code{too-near}
  2177. @end deffn
  2178.  
  2179. @deffn EventType @code{action-done}
  2180. @end deffn
  2181.  
  2182. @deffn EventType @code{insufficient-mp}
  2183. @end deffn
  2184.  
  2185. @deffn EventType @code{cannot-leave-world}
  2186. @end deffn
  2187.  
  2188. @deffn EventType @code{destination-full}
  2189. @end deffn
  2190.  
  2191. @deffn EventType @code{overrun-succeeded}
  2192. @end deffn
  2193.  
  2194. @deffn EventType @code{overrun-failed}
  2195. @end deffn
  2196.  
  2197. @deffn EventType @code{capture-succeeded}
  2198. @end deffn
  2199.  
  2200. @deffn EventType @code{capture-failed}
  2201. @end deffn
  2202.  
  2203. @deffn EventType @code{fire-into-outside-world}
  2204. @end deffn
  2205.  
  2206. @deffn EventType @code{zz-log-head}
  2207. An administrative event that should never be written out nor read in.
  2208. @end deffn
  2209.  
  2210. @node Battle Forms, Types in General, History Forms, Reference Manual
  2211.  
  2212. @section Battle Forms
  2213.  
  2214. Battles always have exactly two ``sides'', referred to as
  2215. the attacker-list or A-list and the defender-list or D-list, so
  2216. as not to confuse them with sides in the game.
  2217.  
  2218. @deffn Form @code{battle} a-list d-list@dots{}
  2219. @end deffn
  2220.  
  2221. Each list has the form
  2222. @example
  2223. ((<unit> <commitment>) ...)
  2224. @end example
  2225.  
  2226. @node Types in General, Unit Types, Battle Forms, Reference Manual
  2227.  
  2228. @section Types in General
  2229.  
  2230. Types are the foundation of @i{Xconq} game designs.
  2231. Nearly all the rules and game parameters are associated
  2232. with the unit, material, and terrain types.
  2233. There is no sort of type hierarchy; instead, most forms allow sets of types
  2234. to be used in the place of single types.
  2235.  
  2236. Each type has an index associated with it, starting from 0.
  2237. This index never appears directly, and cannot be set.
  2238. This does mean that types have an order, so the order in which
  2239. types are defined is sometimes significant.
  2240. These cases will be noted.
  2241. The order is always the order in which the types appear in the file.
  2242.  
  2243. @menu
  2244. * Type Names::                      
  2245. * Type Images::                     
  2246. * Documentation::               
  2247. * Availability::                
  2248. * Type Extension::              
  2249. @end menu
  2250.  
  2251. @node Type Names, Type Images, Types in General, Types in General
  2252.  
  2253. @subsection Type Names
  2254.  
  2255. The names of types need not be distinct from each other,
  2256. but you run the risk of player confusion if they share names.
  2257.  
  2258. @deffn TypeProperty @code{name} string
  2259. This property is the specific name of the type.
  2260. This name will be displayed to players; the exact format
  2261. is up to the interface, but will typically
  2262. depend on the name's length and the space available in the display.
  2263. If no type names have been defined, the internal type name (see below)
  2264. will be used.
  2265. Defaults to @code{""}.
  2266. @end deffn
  2267.  
  2268. @deffn TypeProperty @code{long-name} string
  2269. This property is a fully spelled-out name for the type.
  2270. Defaults to @code{""}.
  2271. @end deffn
  2272.  
  2273. @deffn TypeProperty @code{short-name} string
  2274. This property is an abbreviated name of r
  2275. Defaults to @code{""}.
  2276. @end deffn
  2277.  
  2278. @deffn TypeProperty @code{generic-name} string
  2279. This property is like @code{name}, but identifies the type less specifically,
  2280. and several types may have the same generic name.
  2281. If no generic names are defined, then the regular type names will be used.
  2282. This is useful when making abbreviated lists, so that related types
  2283. get counted together.
  2284. Defaults to @code{()}.
  2285. @end deffn
  2286.  
  2287. As an example of the distinction between type names and generic type name,
  2288. the names of a automobile type might be @code{"1965 Mustang"},
  2289. @code{"Mustang"}, and @code{"M"},
  2290. while the generic name is @code{"auto"}.
  2291. Then the interface could choose to display a parking lot as containing
  2292. either @code{"4 auto"} or @code{"2 Mustang 1 Edsel 1 Jeep"}.
  2293.  
  2294. Note that names specified as properties are strings only, and are
  2295. not defined as evaluable symbols.
  2296.  
  2297. @node Type Images, Documentation, Type Names, Types in General
  2298.  
  2299. @subsection Type Images
  2300.  
  2301. The interpretation of these properties is entirely up to each interface;
  2302. see the appropriate interface documentation for details.
  2303.  
  2304. @deffn TypeProperty @code{image-name} str
  2305. This property is the name of the type's image.
  2306. If undefined or unusable for some reason,
  2307. the interface will display the type in some default manner, such as
  2308. a solid-color square or a string.
  2309. @end deffn
  2310.  
  2311. For example, in X11,
  2312. the name might be the name of a file in the usual bitmap format, as
  2313. produced by the @var{bitmap} program.  The actual file name is produced
  2314. by appending @code{".b"}.
  2315. (The situation in X is actually more complicated than this.)
  2316. See the interface documentation for details on how the interface
  2317. uses the image.
  2318.  
  2319. @deffn TypeProperty @code{color} str
  2320. This property is the name of the preferred color for this type.
  2321. Both normal color names and the strings @code{"bg"} and @code{"fg"}
  2322. (meaning ``foreground color'' and ``background color'')
  2323. may be used.
  2324. If the image is in color, then this property has no effect.
  2325. Defaults to @code{"fg"}.
  2326. @end deffn
  2327.  
  2328. @deffn TypeProperty @code{char} str
  2329. This property supplies a single character for this type
  2330. (all characters after the first one in @var{str} are ignored).
  2331. Defaults to @code{""}.
  2332. @end deffn
  2333.  
  2334. @node Documentation, Availability, Type Images, Types in General
  2335.  
  2336. @subsection Documentation
  2337.  
  2338. @deffn TypeProperty @code{description-format} list@dots{}
  2339. This property defines the different ways in which
  2340. an instance or instances of this type may be described textually.
  2341. This information may be used in narrative descriptions and by some
  2342. interfaces.
  2343. [describe syntax of the lists - are similar to name grammars]
  2344. If @code{()}, then the instance will be described in some default
  2345. fashion, such as (for units) @code{"the <side> <ordinal> <type>"}.
  2346. Defaults to @code{()}.
  2347. @end deffn
  2348.  
  2349. @deffn TypeProperty @code{help} string
  2350. This property is a brief (preferably one-line) description of the type.
  2351. Defaults to @code{""}.
  2352. @end deffn
  2353.  
  2354. @deffn TypeProperty @code{notes} strings@dots{}
  2355. This property is detailed documentation about the type. 
  2356. The formatting of the strings is up to the interface,
  2357. but in general each string is a separate line,
  2358. the string @code{""} indicates a line break,
  2359. and two @code{""} in a row indicates a paragraph break.
  2360. Defaults to @code{()}.
  2361. @end deffn
  2362.  
  2363. @node Availability, Type Extension, Documentation, Types in General
  2364.  
  2365. @subsection Availability
  2366.  
  2367. It may be that a set of types is larger than strictly necessary for
  2368. a particular game.  You can make any type unavailable, which means
  2369. that irrespective of any other controls, that type cannot come into
  2370. play during a game.  You can also make it available only for particular
  2371. turns.
  2372.  
  2373. @deffn TypeProperty @code{available} n
  2374. If the value of this property is greater than 0, then this type is available
  2375. in the game on or after turn @var{n}.
  2376. If the value is less than 0, then the type is available,
  2377. but only until turn @var{-n}.
  2378. If the value is 0, then the type is never available.
  2379. Defaults to @code{1}, which means that the type is always available.
  2380. @end deffn
  2381.  
  2382. If a type becomes unavailable and there are units of that type in play,
  2383. then they will vanish immediately.
  2384.  
  2385. @node Type Extension, , Availability, Types in General
  2386.  
  2387. @subsection Type Extension
  2388.  
  2389. It may occasionally be necessary to add new kinds of
  2390. information to a type.
  2391. For instance, new synthesis methods may require special data,
  2392. or an interface may be able to use extra hints to improve its display.
  2393. The @code{extensions} property can be used to store this kind of data.
  2394.  
  2395. @deffn TypeProperty @code{extensions} properties@dots{}
  2396. This property is a catch-all for nonstandard type properties.
  2397. Anything may appear here, but it will only be interpreted as much as needed,
  2398. and unrecognized extensions will not be warned about (so if you misspell
  2399. one, you won't find out).
  2400. @end deffn
  2401.  
  2402. @node Unit Types, Terrain Types, Types in General, Reference Manual
  2403.  
  2404. @section Unit Types
  2405.  
  2406. @deffn Form @code{unit-type} symbol properties@dots{}
  2407. This form defines a new type of unit.
  2408. The @var{symbol} is required and must be previously undefined.
  2409. The bindings in @var{properties} are then added to the type one by one.
  2410. If no other name properties are defined, the @var{symbol} may be displayed
  2411. to players (see above).
  2412. You can define no more than 126 types of units.
  2413. @end deffn
  2414.  
  2415. The @var{symbol} here becomes the unit type's ``internal type name''
  2416. which is guaranteed unique.
  2417. To make synonyms for the internal type name, use @code{define}.
  2418.  
  2419. @deffn GlobalVariable @code{u*}
  2420. This variable evaluates to a list of all unit types,
  2421. listed in the order that they were defined.
  2422. This list always reflects the list of types at the moment it is evaluated.
  2423. @end deffn
  2424.  
  2425. @deffn GlobalVariable @code{non-unit}
  2426. This variable [constant?] evaluates to a value that is NOT a unit type.
  2427. This is needed in several places to enable/disable features.
  2428. Use of this in any other way is an error,
  2429. and may or may not be detected before it causes a crash.
  2430. @end deffn
  2431.  
  2432. @menu
  2433. * Unit Naming::                 
  2434. * Class-Restricted Unit Types::  
  2435. * Self-Unit Capable Units::                  
  2436. * Limits on Unit Quantities::    
  2437. * Hit Points::                  
  2438. * Experience::                  
  2439. * Tech Levels vs Units::                 
  2440. * Opinions::                    
  2441. * Point Value::                 
  2442. @end menu
  2443.  
  2444. @node Unit Naming, Class-Restricted Unit Types, Unit Types, Unit Types
  2445.  
  2446. @subsection Unit Naming
  2447.  
  2448. @deffn UnitTypeProperty @code{namer} namer-id
  2449. This property is the namer that will be used to generate names for units,
  2450. if the unit's side does not have a namer, or the unit is
  2451. independent and not in any country.
  2452. Defaults to @code{0}, which leaves the unit unnamed.
  2453. @end deffn
  2454.  
  2455. @deffn UnitTypeProperty @code{assign-number} t/f
  2456. This property is true if the unit should have a serial number assigned to it
  2457. by the side it belongs to.
  2458. Serial numbers are maintained for each type on each side separately,
  2459. start at 1 for the first unit of the type, and increase by one each time.
  2460. Defaults to @code{true}.
  2461. @end deffn
  2462.  
  2463. @node Class-Restricted Unit Types, Self-Unit Capable Units, Unit Naming, Unit Types
  2464. @subsection Class-Restricted Unit Types
  2465.  
  2466. Sometimes the designer will want to make different sides have different types
  2467. of units.  Although this can be done by setting up scenarios appropriately,
  2468. that won't close all the loopholes that might allow a side to get units that
  2469. should only ever belong to another side.
  2470.  
  2471. The first step is to define a class for each side.  For instance,
  2472. a side named @code{"Rome"} might have a class @code{"Roman"},
  2473. while the sides named @code{"Aedui"} and @code{"Parisii"}
  2474. could both be in the class @code{"barbarian"}.
  2475.  
  2476. @deffn UnitTypeProperty @code{possible-sides} exp
  2477. This property restricts the unit type to only be usable
  2478. by a side meeting the conditions of @var{exp}.
  2479. If @var{exp} is a string, it restricts the unit type to only
  2480. be usable by a side whose class includes a matching string.
  2481. This can also be a boolean combination.
  2482. Independent units belong to a side whose class is @code{"independent"}.
  2483. The default of @code{""} allows the unit to belong to any side.
  2484. @end deffn
  2485.  
  2486. @node Self-Unit Capable Units, Limits on Unit Quantities, Class-Restricted Unit Types, Unit Types
  2487.  
  2488. @subsection Self-Unit Capable Units
  2489.  
  2490. The self-unit can be any type, including one that cannot act;
  2491. for instance, a capital city could be the self-unit, thus making
  2492. its defense all-important for a player.
  2493.  
  2494. @deffn GlobalVariable @code{self-required} t/f
  2495. This variable is true if each side is required to have a self-unit
  2496. at all times.
  2497. However, if no unit of a suitable type is available when the game begins,
  2498. then none will be required.
  2499. Defaults to @code{false}.
  2500. [this should also have a related side property?]
  2501. [rounding-down advantage should not eliminate one needed as self-unit?]
  2502. @end deffn
  2503.  
  2504. @deffn UnitTypeProperty @code{can-be-self} t/f
  2505. This property says that the type of unit can represent the side directly.
  2506. Defaults to @code{false}.
  2507. @end deffn
  2508.  
  2509. @deffn UnitTypeProperty @code{self-changeable} t/f
  2510. This property is true if the player can choose to change a self-unit of
  2511. this type at any time.
  2512. Otherwise the self-unit can be changed only if the current one dies.
  2513. Defaults to @code{false}.
  2514. @end deffn
  2515.  
  2516. @deffn UnitTypeProperty @code{self-resurrects} t/f
  2517. This property is true if when the self-unit dies, another unit of an allowable type
  2518. becomes the self-unit automatically.
  2519. Defaults to @code{false}.
  2520. @end deffn
  2521.  
  2522. Observe that these parameters can be used to develop various forms of
  2523. backup, so that a player can start out as a capital city, resurrect as
  2524. a town, change self to one of several towns, then lose when all the towns
  2525. are lost.
  2526.  
  2527. @deffn UnitTypeProperty @code{direct-control} t/f
  2528. This property is true if a unit of this type can be controlled by its side
  2529. automatically.
  2530. If false, then it must be within range of a unit that can control it,
  2531. and is itself under control by the side.
  2532. Defaults to @code{true}.
  2533. @end deffn
  2534.  
  2535. @deffn Table @code{control-chance-at} u1 u2 -> n%
  2536. @end deffn
  2537.  
  2538. @deffn Table @code{control-chance-adjacent} u1 u2 -> n%
  2539. @end deffn
  2540.  
  2541. @deffn Table @code{control-chance} u1 u2 -> n%
  2542. @end deffn
  2543.  
  2544. @deffn Table @code{control-range} u1 u2 -> dist
  2545. This table gives the maximum distance from self-unit @var{u1}
  2546. at which units of type @var{u2}
  2547. can be controlled directly.  Units further away always act on their own
  2548. (as if the doctrine said so[?]).
  2549. If this value is < 0, then @var{u1} can never directly control
  2550. any other @var{u2} on the side.
  2551. Defaults to @code{infinity}.
  2552. @end deffn
  2553.  
  2554. @node Limits on Unit Quantities, Hit Points, Self-Unit Capable Units, Unit Types
  2555.  
  2556. @subsection Limits on Unit Quantities
  2557.  
  2558. The effect of these is
  2559. to prevent any extra units from being created or from going over to a
  2560. side, regardless of the reason.
  2561. This happens by either preventing player actions that would
  2562. result in exceeding a limit (such as when building units), or by making
  2563. the unit vanish instantly (such as when capturing a unit).
  2564.  
  2565. @deffn GlobalVariable @code{units-in-game-max} n
  2566. This variable is the maximum number of all types of units, on all sides,
  2567. including independents, that may exist at any time, including initially.
  2568. Defaults to @code{-1}, which means that there is no limit.
  2569. @end deffn
  2570.  
  2571. @deffn GlobalVariable @code{units-per-side-max} n
  2572. This variable is the maximum number of units (of all types together) 
  2573. that any side may have, at any time.  Events that would cause
  2574. the limit to be exceeded, such as capturing a unit, result in
  2575. either the unit vanishing or becoming independent.
  2576. Defaults to @code{-1}, which means that there is no limit.
  2577. @end deffn
  2578.  
  2579. There is no limit on the number of units that may be independent.
  2580.  
  2581. @deffn UnitTypeProperty @code{type-in-game-max} n
  2582. This property is the maximum total of the given type, for all sides together.
  2583. Defaults to @code{-1}, which means that there is no limit.
  2584. @end deffn
  2585.  
  2586. @deffn UnitTypeProperty @code{type-per-side-max} n
  2587. This property is the maximum number of units of the given type allowed to each side.
  2588. Defaults to @code{-1}, which means that there is no limit.
  2589. @end deffn
  2590.   
  2591. @node Hit Points, Experience, Limits on Unit Quantities, Unit Types
  2592.  
  2593. @subsection Hit Points
  2594.  
  2595. A unit's hit points determine how healthy it is.
  2596. If a unit's hp goes below 1, it is either @dfn{wrecked},
  2597. meaning that it changes to a new type
  2598. @code{wrecked-type} or else it @dfn{vanishes},
  2599. meaning that it is completely cleared from the world.
  2600.  
  2601. @deffn UnitTypeProperty @code{hp-max} n
  2602. This property is the maximum number of hit points for (each part of) a unit.
  2603. Completed units start with this many hit points.
  2604. Defaults to @code{1}.
  2605. @end deffn
  2606.  
  2607. @deffn UnitTypeProperty @code{parts-max} n
  2608. This property declares that a unit is really
  2609. an aggregate of @var{n} smaller identical units.
  2610. Defaults to @code{1}.
  2611. @end deffn
  2612.  
  2613. @deffn UnitTypeProperty @code{wrecked-type} unit-type
  2614. This property is the type of unit that a unit with 0 hp will become.
  2615. For instance, a destroyed ``fort'' might become a ``rubble pile'' unit.
  2616. If its value is @code{non-unit}, then the destroyed unit just vanishes.
  2617. The @code{wrecked-type} of a type must be a different type.
  2618. Defaults to @code{non-unit}.
  2619. @end deffn
  2620.  
  2621. The transformation to the wrecked type does not change position or name.
  2622. The transformed unit has full hp, supplies are conserved as much as possible,
  2623. tooling is preserved, and any unit plan is erased.
  2624. It has the same number of parts, or as many as possible if that is fewer.
  2625. It may be that the
  2626. wrecked type is on terrain that it cannot survive on; in that case, it
  2627. will be wrecked again, repeating until the unit either vanishes
  2628. or is in a viable position, or this process has been repeated
  2629. more times than the number of unit types (prevents infinite loops).
  2630. Any excess occupants will be removed and either placed in another nearby
  2631. unit or in the open, or will vanish if there is no other option.
  2632.  
  2633. @deffn UnitTypeProperty @code{hp-recovery} n
  2634. This property is the number of 1/100 hp recovered per turn.
  2635. Recovery happens automatically at the end of each turn.
  2636. The amount @i{n} / 100 is recovered automatically each turn,
  2637. while @i{n} mod 100 is the percent chance of recovering 
  2638. an additional 1 hit point.
  2639. Defaults to @code{0}.
  2640. @end deffn
  2641.  
  2642. @node Experience, Tech Levels vs Units, Hit Points, Unit Types
  2643.  
  2644. @subsection Experience
  2645.  
  2646. @deffn UnitTypeProperty @code{cxp-max} cxp
  2647. This property is the maximum combat experience this type of unit can have.
  2648. Defaults to @code{0}.
  2649. @end deffn
  2650.  
  2651. @node Tech Levels vs Units, Opinions, Experience, Unit Types
  2652.  
  2653. @subsection Tech Levels vs Units
  2654.  
  2655. Before it can do anything with a type of unit,
  2656. the side must have the appropriate tech level for that type,
  2657. which is just a number ranging from 0 up to @code{tech-level-max}.
  2658. Each type has a distinct tech level.
  2659.  
  2660. Tech levels always increase
  2661. (since they represent abstract knowledge rather than physical plant).
  2662. Tech can be transferred freely to any other side
  2663. via the message @code{tech} [xref to messages].
  2664.  
  2665. For each unit type, the following parameters define the minimum tech levels at
  2666. which sides can do various things.
  2667.  
  2668. @deffn UnitTypeProperty @code{tech-to-see} tl
  2669. This property is the minimum tech level that a side must have before it can see
  2670. a unit of this type.
  2671. Defaults to @code{0}.
  2672. @end deffn
  2673.  
  2674. @deffn UnitTypeProperty @code{tech-to-own} tl
  2675. This property is the minimum tech level
  2676. that a side must have in order to have a unit of this type.
  2677. Defaults to @code{0}.
  2678. @end deffn
  2679.  
  2680. @deffn UnitTypeProperty @code{tech-from-ownership} tl
  2681. This property is the tech level that may be reached
  2682. by acquiring a unit of this type.
  2683. Since this is expressed as a minimum,
  2684. multiple acquisitions have no additional effect.
  2685. Defaults to @code{0}.
  2686. @end deffn
  2687.  
  2688. @deffn UnitTypeProperty @code{tech-to-use} tl
  2689. This property is the minimum tech level that a side must have in order to
  2690. give actions to this type of unit.
  2691. Defaults to @code{0}.
  2692. @end deffn
  2693.  
  2694. @deffn UnitTypeProperty @code{tech-to-build} tl
  2695. This property is the minimum tech level that a side
  2696. must have in order to build this type of unit.
  2697. Defaults to @code{0}.
  2698. @end deffn
  2699.  
  2700. @deffn UnitTypeProperty @code{tech-max} tl
  2701. This property is the absolute maximum tech level possible for this type.
  2702. Defaults to @code{0}.
  2703. @end deffn
  2704.  
  2705. @deffn Table @code{tech-crossover} u1 u2 -> n%
  2706. This table is the minimum tech level for @var{u2} that is guaranteed by a particular
  2707. tech level for @var{u1}, expressed as a percentage of the @code{tech-max}
  2708. for the types.
  2709. For instance, if @code{tech-crossover} is 80, and the tech level for @var{u1}
  2710. is 10 out of a max of 20, and the max for @var{u2} is also 20,
  2711. then the side has a tech for @var{u2} at least 8.
  2712. Defaults to @code{0}.
  2713. @end deffn
  2714.  
  2715. It is possible to gain some tech level just by being in the same game
  2716. with a side that is more advanced.
  2717.  
  2718. @deffn UnitTypeProperty @code{tech-leakage} .01tl
  2719. This property is the amount of tech level gain per turn that can happen
  2720. to any side's tech level that is less than the max of all sides in the game.
  2721. This only happens if at least one unit on the side has nonzero coverage
  2722. of a unit on a more advanced side.
  2723. Defaults to @code{0}.
  2724. @end deffn
  2725.  
  2726. @node Opinions, Point Value, Tech Levels vs Units, Unit Types
  2727.  
  2728. @subsection Opinions
  2729.  
  2730. @deffn UnitTypeProperty @code{has-opinions} t/f
  2731. This property is true if the unit has opinions about sides,
  2732. both other sides and its own.
  2733. Defaults to @code{false}.
  2734. @end deffn
  2735.  
  2736. @node Point Value, , Opinions, Unit Types
  2737.  
  2738. @subsection Point Value
  2739.  
  2740. Point values provide an abstract way to characterize the overall importance
  2741. of a unit type.
  2742. Point values figure into some scorekeepers, and are used by AIs.
  2743.  
  2744. @deffn UnitTypeProperty @code{point-value} n
  2745. This property is the ``value'' of a unit.
  2746. Defaults to @code{1}.
  2747. @end deffn
  2748.  
  2749. @node Terrain Types, Material Types, Unit Types, Reference Manual
  2750.  
  2751. @section Terrain Types
  2752.  
  2753. Terrain types are associated with the cells, borders,
  2754. connections, and coatings in a world.
  2755.  
  2756. @deffn Form @code{terrain-type} name properties@dots{}
  2757. This form defines a new type of terrain, named by @var{name}.
  2758. Details are similar to those for unit types.
  2759. @end deffn
  2760.  
  2761. @deffn GlobalVariable @code{t*}
  2762. This variable evaluates to a list of all terrain types,
  2763. listed in the order that they were defined.
  2764. @end deffn
  2765.  
  2766. @deffn GlobalVariable @code{non-terrain}
  2767. This variable has a value that is guaranteed not to be a terrain type.
  2768. @end deffn
  2769.  
  2770. @menu
  2771. * Terrain Subtypes::            
  2772. * Terrain Compatibility::       
  2773. * Other Terrain Properties::    
  2774. * People::                      
  2775. @end menu
  2776.  
  2777. @node Terrain Subtypes, Terrain Compatibility, Terrain Types, Terrain Types
  2778.  
  2779. @subsection Terrain Subtypes
  2780.  
  2781. Terrain can appear in four different roles: as the interior of
  2782. a cell, as a border between cells, as a connection between cells,
  2783. or as a coating overlaying the normal terrain.
  2784. The terrain subtype says which role a type can play.
  2785.  
  2786. @deffn TerrainTypeProperty @code{subtype} subtype
  2787. This property is the role that the terrain type can appear in.
  2788. Defaults to @code{cell}.
  2789. @end deffn
  2790.  
  2791. @deffn GlobalConstant @code{cell}
  2792. This constant indicates that terrain can fill a cell.
  2793. All units in the open and with an altitude of 0 are assumed
  2794. to be surrounded by the cell terrain.
  2795. @end deffn
  2796.  
  2797. @deffn GlobalConstant @code{border}
  2798. This constant indicates that the terrain can be a border.
  2799. @end deffn
  2800.  
  2801. @deffn GlobalConstant @code{connection}
  2802. This constant indicates that the terrain can be a connection.
  2803. @end deffn
  2804.  
  2805. @deffn GlobalConstant @code{coating}
  2806. This constant indicates that the terrain can be a coating.
  2807. A @dfn{coating} is a temporary terrain modification.
  2808. The classic example is snow,
  2809. which effectively changes some kinds of terrain,
  2810. but not completely and usually not permanently.
  2811. Cells can have varying heaviness of each type of coating.
  2812. @end deffn
  2813.  
  2814. @deffn Table @code{coating-depth-min} t1 t2 -> n
  2815. In order for a coating @var{t1} to ``stick'',
  2816. this table says much must be added all at once to terrain @var{t2}.
  2817. A coating depth that drops below this will disappear immediately.
  2818. Defaults to @code{0}.
  2819. @end deffn
  2820.  
  2821. @deffn Table @code{coating-depth-max} t1 t2 -> n
  2822. This table is the upper limit on coating depth.
  2823. Defaults to @code{0}.
  2824. @end deffn
  2825.  
  2826. Terrain types may have additional subtype attributes that
  2827. are used only during synthesis, to select appropriate subtypes
  2828. for special purposes.
  2829.  
  2830. @deffn TerrainTypeProperty @code{subtype-x} n
  2831. This property is extra subtype information, used in synthesis.
  2832. Defaults to @code{no-x}.
  2833. @end deffn
  2834.  
  2835. @deffn GlobalConstant @code{no-x}
  2836. @end deffn
  2837.  
  2838. @deffn GlobalConstant @code{river-x}
  2839. This constant indicates that synthesis methods should treat this
  2840. type as a river.
  2841. The terrain type may be either a border or a connection.
  2842. @end deffn
  2843.  
  2844. @deffn GlobalConstant @code{valley-x}
  2845. This constant indicates that synthesis methods should treat this type
  2846. as a valley.
  2847. @end deffn
  2848.  
  2849. @deffn GlobalConstant @code{road-x}
  2850. This constant indicates that synthesis methods should treat this type
  2851. as a road.
  2852. @end deffn
  2853.  
  2854. @deffn TerrainTypeProperty @code{liquid} t/f
  2855. This property is true if the terrain type represents a liquid,
  2856. which means that adjacent cells of liquid must have the same elevation.
  2857. Defaults to @code{false}.
  2858. @end deffn
  2859.  
  2860. @node Terrain Compatibility, Other Terrain Properties, Terrain Subtypes, Terrain Types
  2861.  
  2862. @subsection Terrain Compatibility
  2863.  
  2864. Terrain types are not always mutually compatible.
  2865. Incompatible types may not be juxtaposed, either at
  2866. game setup time or by unit action during a game.
  2867.  
  2868. @deffn Table @code{adjacent-terrain-effect} t1 t2 -> t3
  2869. This table specifies what will happen to a cell of type @var{t1}
  2870. adjacent to a cell of type @var{t2}.  If @var{t3} is @code{non-terrain},
  2871. nothing will happen, otherwise it will become a cell of type @var{t3}.
  2872.  
  2873. If @var{t1} is a border type adjacent to a cell of type @var{t2}.
  2874. If @var{t3} is @code{non-terrain}, nothing will happen.
  2875. Otherwise, the border of type @var{t1} will be removed,
  2876. and if @var{t3} is a border type, a border of that type will be added.
  2877. The effect on connection types is analogous.
  2878. Defaults to @code{non-terrain}.
  2879. @end deffn
  2880.  
  2881. @node Other Terrain Properties, , Terrain Compatibility, Terrain Types
  2882.  
  2883. @subsection Other Terrain Properties
  2884.  
  2885. @deffn TerrainTypeProperty @code{elevation-min} dist
  2886. @end deffn
  2887. @deffn TerrainTypeProperty @code{elevation-max} dist
  2888. These properties define the minimum and maximum possible values
  2889. for the elevation in a cell of given terrain type.
  2890. Both default to @code{0}.
  2891. @end deffn
  2892.  
  2893. @deffn TerrainTypeProperty @code{temperature-min} n
  2894. @end deffn
  2895. @deffn TerrainTypeProperty @code{temperature-max} n
  2896. These properties define the minimum and maximum possible values
  2897. for the temperature in a cell of given terrain type.
  2898. Both default to @code{0}.
  2899. @end deffn
  2900.  
  2901. @deffn TerrainTypeProperty @code{wind-force-min} n
  2902. @end deffn
  2903. @deffn TerrainTypeProperty @code{wind-force-max} n
  2904. These properties define limits on wind force.
  2905. Both default to @code{0}.
  2906. @end deffn
  2907.  
  2908. @deffn TerrainTypeProperty @code{clouds-min} n
  2909. @end deffn
  2910. @deffn TerrainTypeProperty @code{clouds-max} n
  2911. These properties define limits on cloud density.
  2912. Both default to @code{0}.
  2913. @end deffn
  2914.  
  2915. @node Material Types, Static Relationships Between Types, Terrain Types, Reference Manual
  2916.  
  2917. @section Material Types
  2918.  
  2919. Materials are materials that are manipulated in mass quantities.
  2920. In general, material types just index vectors of values attached
  2921. to other objects, such as unit supplies.
  2922.  
  2923. No more than 126 types of material may be defined.
  2924.  
  2925. @deffn Form @code{material-type} symbol properties@dots{}
  2926. This form defines a new type of material, named by @var{symbol}.
  2927. Details are similar to those for unit types.
  2928. @end deffn
  2929.  
  2930. @deffn GlobalVariable @code{m*}
  2931. This variable evaluates to a list of all material types,
  2932. listed in the same order as they were defined.
  2933. @end deffn
  2934.  
  2935. @deffn GlobalVariable @code{non-material}
  2936. This variable has a value that is never a material type.
  2937. @end deffn
  2938.  
  2939. @menu
  2940. * People::
  2941. @end menu
  2942.  
  2943. @node People, , , Material Types
  2944.  
  2945. @subsection People
  2946.  
  2947. A material type can be designated as representing people.
  2948.  
  2949. @deffn MaterialTypeProperty @code{people} n
  2950. This property is the actual number of individuals
  2951. represented by 1 of a material.
  2952. If 0, then the material type does not have people associated with it at all.
  2953. Defaults to @code{0}.
  2954. @end deffn
  2955.  
  2956. Multiple types of materials can represent different types of people,
  2957. so for example there could be one type @code{nomad} with 10 people/material,
  2958. and another type @code{urbanite} with 10,000 people/material.
  2959.  
  2960. The basic cell capacities for materials also constrain people
  2961. materials. There can be an additional limit on the number of individuals.
  2962.  
  2963. @deffn TerrainTypeProperty @code{people-max} n
  2964. This property is the maximum number of individuals allowed
  2965. in a cell of this type of terrain.
  2966. This is checked at the end of each turn;
  2967. any excess will be moved into adjacent cells or disappear entirely.
  2968. Defaults to @code{-1}, which allows any number of people in a cell.
  2969. @end deffn
  2970.  
  2971. @node Static Relationships Between Types, Vision, Material Types, Reference Manual
  2972.  
  2973. @section Static Relationships Between Types
  2974.  
  2975. In general, static relationships are those that must always hold
  2976. during a turn.  @i{Xconq} will usually only test these when
  2977. necessary, but this is up to the implementation.
  2978. From the players' and designers' point of view, these relationships
  2979. can never be violated, even temporarily.
  2980.  
  2981. @menu
  2982. * Occupants and Transports::    
  2983. * Units and Terrain::           
  2984. * Units and Materials::         
  2985. * Terrain and Materials::       
  2986. @end menu
  2987.  
  2988. @node Occupants and Transports, Units and Terrain, , Static Relationships Between Types
  2989.  
  2990. @subsection Occupants and Transports
  2991.  
  2992. A unit inside another unit is an ``occupant'' in a ``transport'',
  2993. even if the ``transport'' can never move.
  2994. There are two kinds of capacity.  Generic capacity is shared by
  2995. all different types, while guaranteed capacity is for a particular
  2996. type only.
  2997.  
  2998. @deffn UnitTypeProperty @code{capacity} n
  2999. This property is the limit on the sum of sizes of units that may occupy this
  3000. type of unit, not counting the exclusive capacities.
  3001. Defaults to @code{0}.
  3002. @end deffn
  3003.  
  3004. @deffn Table @code{unit-size-as-occupant} u1 u2 -> n
  3005. This table is the ``size'' of a (full-sized) unit @var{u1} when it is in
  3006. a transport @var{u2}.
  3007. Defaults to @code{1}.
  3008. @end deffn
  3009.  
  3010. @deffn Table @code{unit-capacity-x} u1 u2 -> n
  3011. This table is the number of units of type @var{u2} that are guaranteed
  3012. a place in a unit of type @var{u1}.
  3013. Defaults to @code{0}.
  3014. @end deffn
  3015.  
  3016. @deffn Table @code{occupant-max} u1 u2 -> n
  3017. This table is the upper limit on the number of occupants of this type
  3018. (not counting @code{unit-capacity-x}).
  3019. Defaults to @code{0}.
  3020. @end deffn
  3021.  
  3022. @deffn UnitTypeProperty @code{occupant-total-max} n
  3023. This property is the upper limit on occupants of all types together.
  3024. Defaults to @code{-1}, which allows unlimited occupancy.
  3025. @end deffn
  3026.  
  3027. A unit that is an occupant may not always have the same capabilities
  3028. as when it is out in the open.  Its vision, combat, construction, and
  3029. capacity may be affected.
  3030.  
  3031. @deffn Table @code{occupant-vision} u1 u2 -> t/f
  3032. Defaults to @code{true}.
  3033. @end deffn
  3034.  
  3035. @deffn Table @code{occupant-combat} u1 u2 -> n%
  3036. This table defines the effect on the combat abilities
  3037. of a unit of type @var{u1} when an occupant in a unit of type @var{u2}.
  3038. If @code{0}, then the occupant cannot attack or fire.
  3039. Defaults to @code{100}.
  3040. @end deffn
  3041.  
  3042. @deffn Table @code{occupant-can-construct} u1 u2 -> t/f
  3043. This table is @code{true} if @var{u1} can 
  3044. create or complete units while an occupant of @var{u2}.
  3045. Defaults to @code{false}.
  3046. @end deffn
  3047.  
  3048. @deffn Table @code{occupant-can-have-occupants} u1 u2 -> t/f
  3049. This table is @code{true} if @var{u1} can have occupants of its own
  3050. while an occupant of @var{u2}.
  3051. Defaults to @code{false}.
  3052. @end deffn
  3053.  
  3054. @node Units and Terrain, Units and Materials, Occupants and Transports, Static Relationships Between Types
  3055.  
  3056. @subsection Units and Terrain
  3057.  
  3058. This section describes relationships between units and terrain.
  3059. Units can be set to disappear or be wrecked on particular types of
  3060. terrain.  If the terrain can be occupied safely, there may be a limit
  3061. on the numbers of units that can be in the same cell.
  3062.  
  3063. @deffn Table @code{vanishes-on} u t -> t/f
  3064. This table is @code{true} if a unit @var{u} will disappear instantly if it
  3065. somehow ends up on terrain of type @var{t}.
  3066. Defaults to @code{false}.
  3067. @end deffn
  3068.  
  3069. @deffn Table @code{wrecks-on} u t -> t/f
  3070. This table is @code{true} if a unit @var{u} will wreck instantly if it
  3071. somehow ends up on terrain of type @var{t}.
  3072. Defaults to @code{false}.
  3073. @end deffn
  3074.  
  3075. @deffn TerrainTypeProperty @code{capacity} n
  3076. This property is the limit on the sum of unit sizes that may share this cell.
  3077. Defaults to @code{1}.
  3078. @end deffn
  3079.  
  3080. @deffn Table @code{unit-size-in-terrain} u t -> n
  3081. This table is the ``size'' of a (full-sized) unit @var{u} when it is
  3082. in/on the terrain @var{t}.
  3083. Defaults to @code{1}.
  3084. @end deffn
  3085.  
  3086. @deffn Table @code{terrain-capacity-x} u t -> n
  3087. This table is the number of (full-sized) units of type @var{u}
  3088. that are guaranteed to have a place in the cell.
  3089. Defaults to @code{0}.
  3090. @end deffn
  3091.  
  3092. Note that the units' sides are irrelevant;
  3093. the sizes of units of all sides are added together.
  3094. Limits are calculated separately for the connection and open terrain
  3095. in a cell.
  3096.  
  3097. @deffn UnitTypeProperty @code{stack-order} n
  3098. This property is the relative position of this type of unit within a stack of
  3099. different units.
  3100. Larger values put units higher in the stack.
  3101. The exact values are unimportant, they are just used as sort keys.
  3102. The use of this value is to ensure that particular types are ``seen first''
  3103. when looking at a cell, so for instance if a truck and a city are stacked
  3104. on the same cell, everybody will see the city and not the truck.
  3105. The owner of these units can still see them.
  3106. If the stack-order of two units is the same,
  3107. then the higher-numbered type will be higher in the stack.
  3108. Defaults to @code{0}.
  3109. @end deffn
  3110.  
  3111. There is a possible bizarrity with stacking limits and units that can't
  3112. see each other when in the same hex, namely that a player could be prevented
  3113. from moving a unit into a cell that looks like it has enough room.
  3114.  
  3115. @node Units and Materials, Terrain and Materials, Units and Terrain, Static Relationships Between Types
  3116.  
  3117. @subsection Units and Materials
  3118.  
  3119. Units can carry materials.
  3120.  
  3121. @deffn Table @code{unit-storage-x} u m -> n
  3122. This table is the space reserved specifically for each
  3123. type of material.
  3124. Defaults to @code{0}.
  3125. @end deffn
  3126.  
  3127. Materials that represent people may surrender to a unit in their cell.
  3128.  
  3129. @deffn Table @code{people-surrender-chance} u t -> n%
  3130. This table is the base chance that people in terrain of type @var{t}
  3131. will change sides if a unit of type @var{u} is in their cell.
  3132. Defaults to @code{0}.
  3133. @end deffn
  3134.  
  3135. @deffn Table @code{people-surrender-effect} u m -> n
  3136. This is a multiplier that takes the people type into account.
  3137. Defaults to @code{100}.
  3138. @end deffn
  3139.  
  3140. @node Terrain and Materials,  , Units and Materials, Static Relationships Between Types
  3141.  
  3142. @subsection Terrain and Materials
  3143.  
  3144. @deffn Table @code{terrain-storage-x} t m -> n
  3145. This table is the amount of a material @var{m} that can be accumulated in a cell
  3146. with terrain @var{t}.
  3147. Defaults to @code{0}.
  3148. @end deffn
  3149.  
  3150. @node Vision, Game Initialization, Static Relationships Between Types, Reference Manual
  3151.  
  3152. @section Vision
  3153.  
  3154. @menu
  3155. * Basic Vision::
  3156. * Weather Vision::              
  3157. * Line of Sight::               
  3158. * Spying::                      
  3159. @end menu
  3160.  
  3161. @node Basic Vision, Weather Vision, Vision, Vision
  3162.  
  3163. @subsection Basic Vision
  3164.  
  3165. @deffn GlobalVariable @code{see-all} t/f
  3166. This variable is @code{true} if everything in the world, units, terrain, etc,
  3167. is always visible at all times, including initially.
  3168. It takes precedence over @i{all} other visibility and spying parameters.
  3169. Defaults to @code{false}.
  3170. @end deffn
  3171.  
  3172. @deffn GlobalVariable @code{see-terrain-always} t/f
  3173. If this variable is @code{true}, then any side that has seen the terrain of a cell
  3174. will be informed if that terrain ever changes.
  3175. Defaults to @code{true}.
  3176. @end deffn
  3177.  
  3178. @deffn UnitTypeProperty @code{see-always} t/f
  3179. This property is @code{true} when a unit is always visible
  3180. after it has been seen once,
  3181. so that side changes, movements, etc will be seen forever afterwards.
  3182. If the unit moves into terrain that has not been seen,
  3183. then that terrain also becomes seen as well.
  3184. Defaults to @code{false}.
  3185. @end deffn
  3186.  
  3187. @deffn UnitTypeProperty @code{see-occupants} t/f
  3188. This property is @code{true} when a unit's occupants are also seen
  3189. whenever the unit itself is under observation.
  3190. Defaults to @code{false}.
  3191. @end deffn
  3192.  
  3193. @deffn UnitTypeProperty @code{spot-action} t/f
  3194. If this property is @code{true},
  3195. then the unit's chance to be seen by other sides will be
  3196. tested each time the unit acts in any way.
  3197. This property is in addition to the check at the beginning of each turn.
  3198. Defaults to @code{true}.
  3199. @end deffn
  3200.  
  3201. The people in a cell effectively view (for their side)
  3202. all units in that cell.
  3203. Some units can hide from the people.
  3204.  
  3205. @deffn Table @code{people-see-chance} u m -> n%
  3206. This table is the chance that the people of the
  3207. given type @var{m} will see a unit of type @var{u}.
  3208. This will be evaluated for each people type individually,
  3209. once at the beginning of each turn, and once for each populated cell
  3210. that the unit enters during the turn.
  3211. Defaults to @code{100}.
  3212. @end deffn
  3213.  
  3214. @deffn UnitTypeProperty @code{vision-range} dist
  3215. This property is the maximum range of vision coverage by the unit.
  3216. A value of @code{-1} disables all vision,
  3217. @code{0} means only units in the same cell may be seen,
  3218. and @code{1} means units in adjacent cells may be seen.
  3219. Defaults to @code{1}.
  3220. @end deffn
  3221.  
  3222. @deffn Table @code{see-chance-at} u1 u2 -> n%
  3223. @end deffn
  3224. @deffn Table @code{see-chance-adjacent} u1 u2 -> n%
  3225. @end deffn
  3226. @deffn Table @code{see-chance} u1 u2 -> n%
  3227. All default to @code{100}.
  3228. @end deffn
  3229.  
  3230. @deffn Table @code{visibility} u t -> n
  3231. Defaults to @code{100}.
  3232. @end deffn
  3233.  
  3234. @deffn Table @code{vision-night-effect} u t -> n
  3235. This table is the multiplier for unit @var{u}'s vision at night
  3236. in each type of terrain @var{t}.
  3237. Effect is to multiply with both vision range and see-chance.
  3238. Defaults to @code{100}.
  3239. @end deffn
  3240.  
  3241. @node Weather Vision, Line of Sight, Basic Vision, Vision
  3242.  
  3243. @subsection Weather Vision
  3244.  
  3245. @deffn GlobalVariable @code{see-weather-always} t/f
  3246. If true, then weather changes (in cells that have been seen) will always be reported.
  3247. Defaults to @code{true}.
  3248. @end deffn
  3249.  
  3250. @node Line of Sight, Spying, Weather Vision, Vision
  3251.  
  3252. @subsection Line of Sight
  3253.  
  3254. @deffn UnitTypeProperty @code{vision-bend} n
  3255. This property is the amount by which a unit can see ``around corners''.
  3256. 0 means that vision is strictly line-of-sight,
  3257. while 100 means that elevations never obstruct vision.
  3258. Defaults to @code{100}.
  3259. @end deffn
  3260.  
  3261. @deffn Table @code{eye-height} u t -> dist
  3262. This propety is the additional elevation above the unit's position that a unit
  3263. can see with, when in the given terrain.
  3264. Defaults to @code{0}.
  3265. @end deffn
  3266.  
  3267. @deffn TerrainTypeProperty @code{thickness} dist
  3268. This property is the thickness of the terrain, which is the difference between
  3269. the ``ground'' of the terrain and its top.
  3270. Defaults to @code{0}.
  3271. @end deffn
  3272.  
  3273. @node Spying, , Line of Sight, Vision
  3274.  
  3275. @subsection Spying
  3276.  
  3277. A unit type can also be specified to do spying automatically.
  3278. The outcome of spying is calculated once/unit/turn,
  3279. at the beginning of the turn (after move calculation but before
  3280. any players can do anything).
  3281. Spying can happen to any unit not on the spying unit's side.
  3282.  
  3283. @deffn UnitTypeProperty @code{spy-chance} .01n%
  3284. This property is the chance that the unit's spies will find out something.
  3285. Defaults to @code{0}.
  3286. @end deffn
  3287.  
  3288. @deffn UnitTypeProperty @code{spy-range} dist
  3289. This property is the maximum distance at which the unit's spies will find out
  3290. something.
  3291. Defaults to @code{0}.
  3292. @end deffn
  3293.  
  3294. @deffn Table @code{spy-quality} u1 u2 -> n%
  3295. This table gives the chance that @var{u1}'s spies will return information
  3296. about a unit of type @var{u2}.
  3297. Defaults to @code{100}.
  3298. @end deffn
  3299.  
  3300. @node Game Initialization, Synthesis Methods, Vision, Reference Manual
  3301.  
  3302. @section Game Initialization
  3303.  
  3304. Game initialization always starts by resetting all the game-defining data
  3305. structures to an empty state.  This means no types, no world, etc.
  3306. Then @i{Xconq} reads and interprets
  3307. all of the game modules that have been requested.
  3308. These modules may overwrite each other arbitrarily.
  3309. Then any command line or startup options
  3310. are processed (this may involve an interactive dialog),
  3311. and the random number generator is initialized.
  3312. and players are matched with sides
  3313. (any sides needed for players will be created and named at this time).
  3314. @i{Xconq} then executes a number of @i{synthesis methods}
  3315. to do various kinds of setup.
  3316.  
  3317. (Some interfaces might allow for confirmation of the setup before
  3318. launching into the game proper, but this cannot be assumed.)
  3319.  
  3320. Since the details of good game synthesis can be complicated,
  3321. synthesis methods are simply wired-in pieces of code.
  3322. Each method is self-contained; it assumes the game state to be valid,
  3323. it will determine its own applicability and
  3324. produce a valid result.  It will also acquire any data that it
  3325. needs, so does not require any special setup;  however, a method
  3326. may fail to run if it cannot find that data.
  3327. For instance, the usual fractal
  3328. terrain generator needs percentiles for each terrain type, and
  3329. will not function without them.  It may be that all the requested
  3330. synthesis methods fail; this is OK if @i{Xconq}'s data is present
  3331. and consistent, but otherwise @i{Xconq} will shut itself down, since
  3332. it has no remaining alternatives (think of this as a serious
  3333. programming error and fix the game design).
  3334.  
  3335. @node Synthesis Methods, Setup Postprocessing, Game Initialization, Reference Manual
  3336.  
  3337. @section Synthesis Methods
  3338.  
  3339. The synthesis method list specifies which methods will be run,
  3340. and in what order.
  3341. After they have all been run, @i{Xconq} runs a consistency and completeness
  3342. check.  For instance, there should be a world with terrain everywhere.
  3343. Failure at this point is fatal; @i{Xconq} will either exit
  3344. or return to a game setup dialog.
  3345.  
  3346. @menu
  3347. * Synthesis Method List::
  3348. * Fractal World::               
  3349. * Maze World::                  
  3350. * Random World::                
  3351. * Earthlike World::             
  3352. * Making Rivers::            
  3353. * Making Roads::             
  3354. * Making Countries::            
  3355. * Making Independent Units::    
  3356. * Making Weather::              
  3357. * Initial Supply::              
  3358. * Naming Geographical Features::  
  3359. * Naming Units::                
  3360. * Making a Random Date::        
  3361. @end menu
  3362.  
  3363. @node Synthesis Method List, Fractal World, Synthesis Methods, Synthesis Methods
  3364.  
  3365. @subsection Synthesis Method List
  3366.  
  3367. @deffn GlobalVariable @code{synthesis-methods} method-list
  3368. This variable is a list of synthesis methods.
  3369. If the list is empty, no synthesis methods will be run.
  3370. @end deffn
  3371.  
  3372. The list of synthesis methods is ordered, and many contain duplicates,
  3373. so that a method can be run multiple times during setup.
  3374. Note that most of the existing methods will simply return if they
  3375. detect that their work has already been done, so multiple runs will
  3376. have no effect.
  3377.  
  3378. The default synthesis method list is effectively
  3379. @example
  3380. (make-fractal-percentile-terrain
  3381.  make-countries
  3382.  make-independent-units
  3383.  make-roads
  3384.  make-rivers
  3385.  make-weather
  3386.  init-supplies
  3387.  name-geographical-features
  3388. )
  3389. @end example
  3390.  
  3391. The synthesis method list may also contain items of the form
  3392.  
  3393. @example
  3394. ("program" forms...)
  3395. @end example
  3396.  
  3397. For each of these items, @i{Xconq} will attempt to find and run
  3398. an external program named @code{"program"},
  3399. giving it as input the result of evaluating the @code{forms},
  3400. and then reading the output of the program, which must be a valid
  3401. game module.
  3402. The program must be capable of interpreting two arguments;
  3403. the first is the name of the input file it is to read from,
  3404. and the second is the name of the output file it must write to.
  3405. If successful, it should return with a result code of 0;
  3406. otherwise, @i{Xconq} will issue a warning to players.
  3407.  
  3408. Any further details will depend on your system,
  3409. since each will use different conventions.
  3410. Note that this is NOT a portable construct; you cannot assume that
  3411. everybody will have built and installed the program you're using.
  3412.  
  3413. @node Fractal World, Maze World, Synthesis Method List, Synthesis Methods
  3414.  
  3415. @subsection Fractal World
  3416.  
  3417. The fractal world synthesizer can make a variety of natural-looking terrain.
  3418. It relies on a number of parameters to govern a single algorithm.
  3419.  
  3420. @deffn SynthesisMethod @code{make-fractal-percentile-terrain}
  3421. This method generates the terrain layer of a world.
  3422. It works by generating two distinct layers of random blobs,
  3423. known as the ``alt'' and ``wet'' layers,
  3424. then decides on a terrain type for each cell.
  3425. If elevations are defined,
  3426. then this method will use the ``alt'' layer to produce elevations.
  3427. @end deffn
  3428.  
  3429. @deffn GlobalVariable @code{alt-blob-density} n
  3430. @end deffn
  3431. @deffn GlobalVariable @code{wet-blob-density} n
  3432. These variables are the number of blobs to put down,
  3433. expressed as number per 10,000 cells.
  3434. Defaults to @code{500}.
  3435. @end deffn
  3436.  
  3437. @deffn GlobalVariable @code{alt-blob-size} n.f%
  3438. @end deffn
  3439. @deffn GlobalVariable @code{wet-blob-size} n.f%
  3440. These variables are the average number of cells in a blob,
  3441. expressed as number per 10,000 cells.
  3442. Defaults to @code{100}.
  3443. @end deffn
  3444.  
  3445. @deffn GlobalVariable @code{alt-blob-height} n
  3446. @end deffn
  3447. @deffn GlobalVariable @code{wet-blob-height} n
  3448. These variables are the amounts by which to increment or decrement within a blob.
  3449. Defaults to @code{1000}.
  3450. @end deffn
  3451.  
  3452. @deffn GlobalVariable @code{alt-smoothing} n
  3453. @end deffn
  3454. @deffn GlobalVariable @code{wet-smoothing} n
  3455. These variables specify the number of averaging steps
  3456. to perform after the blobs have been generated.
  3457. Defaults to @code{2}.
  3458. @end deffn
  3459.  
  3460. @deffn TerrainTypeProperty @code{alt-percentile-min} n%
  3461. @end deffn
  3462. @deffn TerrainTypeProperty @code{alt-percentile-max} n%
  3463. @end deffn
  3464. @deffn TerrainTypeProperty @code{wet-percentile-min} n%
  3465. @end deffn
  3466. @deffn TerrainTypeProperty @code{wet-percentile-max} n%
  3467. These properties are
  3468. the percentiles of elevations and moistures that result in the given
  3469. terrain type.
  3470. Percentile ranges may overlap, in which case the earlier-defined
  3471. terrain type will be used.
  3472. If a cell has a alt and wet that does not fall in any of the ranges,
  3473. then terrain type 0 will be used there and players will be warned.
  3474. Mins defaults to @code{0}, maxes to @code{100}.
  3475. @end deffn
  3476.  
  3477. @node Maze World, Random World, Fractal World, Synthesis Methods
  3478.  
  3479. @subsection Maze World
  3480.  
  3481. A maze consists of a set of randomly placed ``rooms'' connected by random
  3482. passages.
  3483.  
  3484. @deffn SynthesisMethod @code{make-maze-terrain}
  3485. This method creates terrain that looks like a maze.
  3486. It starts by randomly assigning terrain according to its @code{occurrence},
  3487. similarly to @code{make-random-terrain} below, then carves
  3488. out rooms and passages, filling each of those with terrain
  3489. types according to their respective occurrences.
  3490. @end deffn
  3491.  
  3492. @deffn TerrainTypeProperty @code{maze-room-occurrence} n
  3493. This property is the weighted amount of this terrain type
  3494. in rooms in the maze.
  3495. Defaults to @code{0}.
  3496. @end deffn
  3497.  
  3498. @deffn TerrainTypeProperty @code{maze-passage-occurrence} n
  3499. This property is the weighted amount of this terrain type
  3500. in passageways in the maze.
  3501. Defaults to @code{0}.
  3502. @end deffn
  3503.  
  3504. @deffn GlobalVariable @code{maze-room-density} n
  3505. This variable is the fraction of the maze that is room,
  3506. expressed as the number of cells per 10,000 cells in the area.
  3507. Defaults to @code{1000}.
  3508. @end deffn
  3509.  
  3510. @deffn GlobalVariable @code{maze-passage-density} n
  3511. This variable is the fraction of the area that is passageway,
  3512. expressed as the number of cells per 10,000 cells in the area.
  3513. Defaults to @code{3000}.
  3514. @end deffn
  3515.  
  3516. @node Random World, Earthlike World, Maze World, Synthesis Methods
  3517.  
  3518. @subsection Random World
  3519.  
  3520. The random world generator just assigns terrain and elevations randomly.
  3521.  
  3522. @deffn SynthesisMethod @code{make-random-terrain}
  3523. This method generates completely random terrain.
  3524. It uses a simple weighting to govern how much
  3525. of each terrain type appears, and makes random elevations as well.
  3526. @end deffn
  3527.  
  3528. @deffn TerrainTypeProperty @code{occurrence} n
  3529. This property is the percentage of the world that will be of this type,
  3530. if the terrain is cell terrain.
  3531. If the terrain is border or connection, it is the probability
  3532. (expressed as .01% increments) that any direction of any cell
  3533. will have that border or connection.
  3534. Defaults to @code{1}.
  3535. @end deffn
  3536.  
  3537. @node Earthlike World, Making Rivers, Random World, Synthesis Methods
  3538.  
  3539. @subsection Earthlike World
  3540.  
  3541. Earthlike generation uses algorithms that more closely approximate
  3542. realistic terrain.
  3543.  
  3544. @deffn SynthesisMethod @code{make-earthlike-terrain}
  3545. This method generates terrain that approximates what actually
  3546. appears on Earth.
  3547. @end deffn
  3548.  
  3549. @node Making Rivers, Making Roads, Earthlike World, Synthesis Methods
  3550.  
  3551. @subsection Making Rivers
  3552.  
  3553. Rivers are borders or connections consisting of ``watery terrain''
  3554. that run downhill to regions of water.
  3555.  
  3556. @deffn SynthesisMethod @code{make-rivers}
  3557. This method looks for a border or connection
  3558. terrain type with a @code{subtype-x} of @code{river-x}.
  3559. then uses the world's elevation data to run rivers downhill
  3560. (always choosing the lowest of possible adjacent locations)
  3561. until they reach cell terrain with a @code{subtype} > 0.
  3562. This method will not run if there are no appropriate terrain types,
  3563. nor if there is no elevation data.
  3564. @end deffn
  3565.  
  3566. @deffn TerrainTypeProperty @code{river-chance} n%
  3567. This property is the chance that a river will start in or around a cell of this
  3568. terrain type.
  3569. Defaults to @code{0}.
  3570. @end deffn
  3571.  
  3572. @deffn GlobalVariable @code{river-sink-terrain} t
  3573. If the value of this variable is a terrain type, then a cell completely
  3574. surrounded by river will be changed to be this type.
  3575. Defaults to @code{non-terrain}.
  3576. @end deffn
  3577.  
  3578. Note that the algorithm computes rivers in a deterministic way,
  3579. so high values of @code{river-chance} do not result in tangled rivers.
  3580.  
  3581. @node Making Roads, Making Countries, Making Rivers, Synthesis Methods
  3582.  
  3583. @subsection Making Roads
  3584.  
  3585. The road generation method makes networks of connection terrain between
  3586. particular unit types, usually those resembling cities.
  3587.  
  3588. @deffn SynthesisMethod @code{make-roads}
  3589. This methods synthesizes roads for an area.
  3590. For any connection type of terrain, if no layer has been created for it
  3591. already, and the type has a @code{subtype-x} of 3,
  3592. put down roads between any pair of units whose
  3593. @code{road-chance} is nonzero.
  3594. The method will attempt to share road routes whenever possible,
  3595. and choose terrain according to @code{road-into-chance}.
  3596. @end deffn
  3597.  
  3598. @deffn Table @code{road-chance} u1 u2 -> n%
  3599. This table is the chance that a road will be laid, running
  3600. from a unit of type @var{u1} to one of type @var{u2}.
  3601. This is not a symmmetrical relationship.
  3602. Defaults to @code{0}.
  3603. @end deffn
  3604.  
  3605. @deffn Table @code{road-into-chance} t1 t2 -> n%
  3606. This table is the chance that a road will be chosen to pass
  3607. from terrain of type @var{t1} into terrain of type @var{t2}.
  3608. Defaults to @code{100}.
  3609. @end deffn
  3610.  
  3611. @node Making Countries, Making Independent Units, Making Roads, Synthesis Methods
  3612.  
  3613. @subsection Making Countries
  3614.  
  3615. The @code{make-countries} method sets up the starting units for
  3616. each side, placing them in a confined area, separated from the
  3617. starting units of other sides and taking terrain preferences
  3618. into account.  If requested, this method will also expand the
  3619. country outwards by a specified amount, possibly placing additional
  3620. units in the process.
  3621.  
  3622. @deffn SynthesisMethod @code{make-countries}
  3623. This method works by looking for a likely place for the country,
  3624. randomly places a basic set of starting units within that area,
  3625. then expands the country outwards.
  3626. The parameters give you control over the mix of terrain types
  3627. in the country, as well as the size and relative positions of the
  3628. different countries.
  3629. This method runs on any side with fewer units than it is supposed
  3630. to start with, as given by the parameters below.
  3631. It places groups of units at locations separated from each other
  3632. by specified distances.
  3633. @end deffn
  3634.  
  3635. @deffn GlobalVariable @code{country-radius-min} dist
  3636. This variable is the radius of the country's initial area.
  3637. Defaults to @code{-1}, which allows the algorithm to calculate a ``reasonable''
  3638. country size appropriate to the given number of units.
  3639. @end deffn
  3640.  
  3641. @deffn GlobalVariable @code{country-separation-min} dist
  3642. @end deffn
  3643. @deffn GlobalVariable @code{country-separation-max} dist
  3644. These variables are the minimum and maximum
  3645. distances of country centers from each other, in cells.
  3646. If small, countries will mostly overlap;
  3647. if very large, then attempts to use small worlds will fail;
  3648. if the max and min are too close to each other, placements can also fail.
  3649. For both of these, a value of @code{-1} disables their effect.
  3650. Both default to @code{-1}.
  3651. @end deffn
  3652.  
  3653. The max separation bound needs to be satisfied for a country
  3654. with respect to only @i{one} other country,
  3655. so for instance the final layout may involve a long
  3656. ``string'' of countries where the first and last countries are very far apart
  3657. from each other.
  3658. The minimum bound must be satisfied for all pairs of countries.
  3659.  
  3660. @deffn TerrainTypeProperty @code{country-terrain-min} n
  3661. This property is the minimum amount of terrain
  3662. that must be within the country's initial radius.
  3663. Defaults to @code{0}.
  3664. @end deffn
  3665.  
  3666. @deffn TerrainTypeProperty @code{country-terrain-max} n
  3667. This property is the most terrain of the given type that may appear.
  3668. If @code{-1}, then any amount may be present.
  3669. Defaults to @code{-1}.
  3670. @end deffn
  3671.  
  3672. @deffn UnitTypeProperty @code{start-with} n
  3673. @end deffn
  3674. @deffn UnitTypeProperty @code{independent-near-start} n
  3675. These properties set the number of units of the given type in a player's country.
  3676. These units are randomly scattered within the initial radius,
  3677. and the @code{favored} table (see below) decides which terrains
  3678. will be used.  Units may be placed inside each other; in fact,
  3679. units with no favored terrain will be made into occupants if possible.
  3680.  
  3681. The independent units will be placed after the ones belonging to the side,
  3682. so on the average they will get the less desirable locations in the country.
  3683. Both independent and the side's units will be named using the side's namers.
  3684.  
  3685. Both default to @code{0}.
  3686. @end deffn
  3687.  
  3688. @deffn Table @code{favored-terrain} u t -> n%
  3689. This table sets
  3690. the probability of the unit type being on the given type of terrain at the
  3691. outset.  A value of @code{0} is an absolute prohibition against placing
  3692. the unit on that type of terrain, thus every game must specify at least
  3693. one non-zero value for some terrain type and some initial unit type.
  3694. Defaults to @code{100}.
  3695. @end deffn
  3696.  
  3697. Once the initial country area has been set up,
  3698. then you can allow the countries to expand outwards.
  3699. Expansion occurs at the same rate for all countries.
  3700. Countries may expand into and through each other.
  3701.  
  3702. @deffn TerrainTypeProperty @code{country-growth-chance} n%
  3703. This property is the chance that a country will expand onto an unclaimed cell
  3704. of the given terrain type.
  3705. Defaults to @code{100}.
  3706. @end deffn
  3707.  
  3708. @deffn TerrainTypeProperty @code{country-takeover-chance} n%
  3709. This property is the chance that a country will expand onto another country's cell
  3710. of the given terrain type.
  3711. Defaults to @code{0}.
  3712. @end deffn
  3713.  
  3714. @deffn UnitTypeProperty @code{unit-growth-chance} n.f%
  3715. This property is the chance that a unit of the given type will be placed
  3716. when the country expands onto a cell.
  3717. The unit will only be placed if the @code{favored} chance is also true.
  3718. Defaults to @code{0}.
  3719. @end deffn
  3720.  
  3721. @deffn UnitTypeProperty @code{independent-growth-chance} n.f%
  3722. This property is the chance that an independent unit of the given type will be placed
  3723. when the country expands onto a cell.
  3724. The @code{favored} chance is also evaluated.
  3725. Defaults to @code{0}.
  3726. @end deffn
  3727.  
  3728. @deffn UnitTypeProperty @code{unit-takeover-chance} n.f%
  3729. This property is the chance that a unit of the given type in another country and
  3730. belonging to another side will be given to the growing side.
  3731. Defaults to @code{0}.
  3732. @end deffn
  3733.  
  3734. @deffn UnitTypeProperty @code{independent-takeover-chance} n.f%
  3735. This property is the chance that an independent unit of the given type in
  3736. another country will be given to the growing side.
  3737. Defaults to @code{0}.
  3738. @end deffn
  3739.  
  3740. @deffn GlobalVariable @code{country-radius-max} dist
  3741. This variable is a cap on the country growth process.
  3742. Values between @code{0} and @code{country-radius-min}
  3743. prevent country growth entirely,
  3744. while a value of @code{-1} allows growth to encompass the entire world.
  3745. Defaults to @code{0}.
  3746. @end deffn
  3747.  
  3748. @deffn UnitTypeProperty @code{country-units-max} n
  3749. This property is a cap on the number of units given to the side's country.
  3750. Defaults to @code{-1}, which disables any limit.
  3751. @end deffn
  3752.  
  3753. @deffn GlobalVariable @code{growth-stop-chance} n%
  3754. This variable is the chance that a country's growth will stop,
  3755. if during the current [ring or round] no new cells were added
  3756. to the country.
  3757. Defaults to @code{0}.
  3758. @end deffn
  3759.  
  3760. @deffn TerrainTypeProperty @code{country-people-chance} n%
  3761. This property is the chance that the people's side will be changed to
  3762. match that for the country they are in.
  3763. Defaults to @code{100}.
  3764. @end deffn
  3765.  
  3766. @node Making Independent Units, Making Weather, Making Countries, Synthesis Methods
  3767.  
  3768. @subsection Making Independent Units
  3769.  
  3770. @deffn SynthesisMethod @code{make-independent-units}
  3771. This method scatters independent units randomly
  3772. over the world.
  3773. This method will not run if the specified density of independent units
  3774. has already
  3775. been achieved, for instance from a predefined world or from country placement.
  3776. Independent units that should be inside other independents will be
  3777. handled correctly.
  3778. @end deffn
  3779.  
  3780. @deffn Table @code{independent-density} u t -> n
  3781. This table is the total number of independent units appearing throughout the world,
  3782. at the rate of @var{n} per 10,000 cells
  3783. of the given terrain type.
  3784. Any independent units already placed are counted first,
  3785. so this value represents final density.
  3786. If the sum of values for a given unit type on all terrain types is nonzero,
  3787. then at least one unit of that type will
  3788. be placed, even if the world is very small (i.e. the calculation of
  3789. numbers rounds up not down).
  3790. Defaults to @code{0}.
  3791. @end deffn
  3792.  
  3793. This method uses the @code{favored-terrain} table as the chance that a given
  3794. unit will be placed at a randomly-chosen position,
  3795. and it will keep trying different positions until a suitable one is
  3796. found.
  3797.  
  3798. @deffn TerrainTypeProperty @code{independent-people-chance} .01n%
  3799. This property is the chance that the people of a cell with this terrain type
  3800. will be made independent.
  3801. Deafults to @code{0}.
  3802. @end deffn
  3803.  
  3804. @node Making Weather, Initial Supply, Making Independent Units, Synthesis Methods
  3805.  
  3806. @subsection Making Weather
  3807.  
  3808. @deffn SynthesisMethod @code{make-weather}
  3809. This methods sets up weather-related layer.  These
  3810. include temperature, winds, and clouds.
  3811. @end deffn
  3812.  
  3813. @node Initial Supply, Naming Geographical Features, Making Weather, Synthesis Methods
  3814.  
  3815. @subsection Initial Supply
  3816.  
  3817. By default, all units start out empty of materials.
  3818. The supply initialization method gives each unit a starting supply,
  3819. according to the stockpile tables.
  3820.  
  3821. @deffn SynthesisMethod @code{make-initial-materials}
  3822. This method fills unit and cell supplies to specified levels.
  3823. It will fill all units in existence at the moment it runs,
  3824. including reinforcements [and incomplete?] units.
  3825. Similarly, all cells will be filled.
  3826. @end deffn
  3827.  
  3828. @deffn Table @code{unit-initial-supply} u m -> n
  3829. This table is the amount of each material that each unit will start out with.
  3830. If the initial supply is greater than unit's capacity,
  3831. then the unit will just be filled to capacity.
  3832. Defaults to @code{0}.
  3833. @end deffn
  3834.  
  3835. @deffn Table @code{terrain-initial-supply} t m -> n
  3836. This table is the amount of material @var{m} that each cell
  3837. with terrain @var{t} will start out with.
  3838. This will be limited by the cell's capacity.
  3839. Defaults to @code{0}.
  3840. @end deffn
  3841.  
  3842. @node Naming Geographical Features, Naming Units, Initial Supply, Synthesis Methods
  3843.  
  3844. @subsection Naming Geographical Features
  3845.  
  3846. Although named geographical features don't affect the outcome of a game
  3847. in any way, they are useful for ``color'' and for identifying locations
  3848. more readably.
  3849.  
  3850. @deffn SynthesisMethod @code{name-geographical-features}
  3851. This method identifies and names regions as geographical features,
  3852. such as mountain ranges and islands.
  3853. @end deffn
  3854.  
  3855. @deffn GlobalVariable @code{feature-namers} feature-namer-list
  3856. This variable is a list of feature types and their associated namers.
  3857. This is used for features not intersecting any country
  3858. with a namer for the feature's type.
  3859. Defaults to @code{()}.
  3860. @end deffn
  3861.  
  3862. @deffn GlobalVariable @code{feature-types} feature-expr-list
  3863. This variable is a list of feature types that may be identified.
  3864. Examples: @code{("lake" (group (sea shallows) 1))},
  3865. @code{("peak" (high-point 1 1))}
  3866.  
  3867. Defaults to @code{()}.
  3868. @end deffn
  3869.  
  3870. @node Naming Units, Making a Random Date, Naming Geographical Features, Synthesis Methods
  3871.  
  3872. @subsection Naming Units
  3873.  
  3874. @deffn SynthesisMethod @code{name-units-randomly}
  3875. This method gives names to previously-unnamed units,
  3876. using their usual [?] naming methods.
  3877. @end deffn
  3878.  
  3879. @node Making a Random Date,  , Naming Units, Synthesis Methods
  3880.  
  3881. @subsection Making a Random Date
  3882.  
  3883. @deffn SynthesisMethod @code{make-random-date}
  3884. @end deffn
  3885.  
  3886. [how is this controlled?]
  3887.  
  3888. @node Setup Postprocessing, Naming and Text Generation, Synthesis Methods, Reference Manual
  3889.  
  3890. @section Setup Postprocessing
  3891.  
  3892. Some initialization steps will be done after all synthesis methods
  3893. have been run.  @i{Xconq} will always do these.
  3894.  
  3895. @menu
  3896. * Initial View::
  3897. * Edge Terrain::
  3898. @end menu
  3899.  
  3900. @node Initial View, Edge Terrain, Setup Postprocessing, Setup Postprocessing
  3901.  
  3902. @subsection Initial View
  3903.  
  3904. By default, each side starts out knowing only what its units can
  3905. normally see at the beginning of the first turn.
  3906. These parameters add to that initial view.
  3907.  
  3908. @deffn GlobalVariable @code{terrain-seen} t/f
  3909. This variable is @code{true} if all the terrain of the world is known initially.
  3910. Defaults to @code{false}.
  3911. @end deffn
  3912.  
  3913. @deffn UnitTypeProperty @code{initial-seen-radius} dist
  3914. This property specifies the radius of the area seen around each of
  3915. the starting units.
  3916. It computes visibility of terrain (cells and borders) only.
  3917. Defaults to @code{1} (which is a no-op if the unit's @code{vision-range}
  3918. is greater than or equal to 1).
  3919. @end deffn
  3920.  
  3921. @deffn UnitTypeProperty @code{already-seen} n%
  3922. This property is the chance to see units of this type at
  3923. the beginning of the game.
  3924. This applies only to units belonging to another side,
  3925. and on known terrain.
  3926. The effect is one-time, so if an @code{already-seen} unit changes
  3927. sides later on, other players will not see the change unless
  3928. they have the unit under observation for themselves.
  3929. Note that @code{see-always} implies @code{already-seen}.
  3930. Defaults to @code{0}.
  3931. @end deffn
  3932.  
  3933. @deffn UnitTypeProperty @code{already-seen-independent} n%
  3934. This property is like @code{already-seen},
  3935. but applies to independent units specifically.
  3936. Defaults to @code{0}.
  3937. @end deffn
  3938.  
  3939. @node Edge Terrain, , Initial View, Setup Postprocessing
  3940.  
  3941. @section Edge Terrain
  3942.  
  3943. @deffn GlobalVariable @code{edge-terrain}
  3944. This variable is the type of terrain to fill in on all the edges of a world.
  3945. The edges of a world have little or no effect on the game,
  3946. but the terrain type should be something distinctive, so that players
  3947. can recognize the edges easily.  (For instance, ice is usually a good choice
  3948. for edges, but probably not on a map of Antarctica!)
  3949. @end deffn
  3950.  
  3951. @node Naming and Text Generation, Actions, Setup Postprocessing, Reference Manual
  3952.  
  3953. @section Naming and Text Generation
  3954.  
  3955. @i{Xconq} can generate names for sides, units, and geographical features.
  3956. Although most naming happens during game setup, names may be assigned
  3957. throughout the course of a game, both automatically and by player request.
  3958.  
  3959. @menu
  3960. * Naming Sides::                
  3961. * Namers::                      
  3962. * Naming Methods::              
  3963. @end menu
  3964.  
  3965. @node Naming Sides, Namers, Naming and Text Generation, Naming and Text Generation
  3966.  
  3967. @subsection Naming Sides
  3968.  
  3969. Side naming is special, because several different but related names
  3970. have to be produced.
  3971.  
  3972. @deffn Variable @code{side-library} side-info@dots{}
  3973. This variable is a weighted list of groups of side properties,
  3974. each of which may be used to fill in a side.
  3975. @end deffn
  3976.  
  3977. The form of each side name entry is basically a subset of the
  3978. side's properties:
  3979. @example
  3980. ([weight] ... (name "name") ... (color-scheme "colors") ...)
  3981. @end example
  3982. Each entry can include as many or as few of the attributes as desired;
  3983. any missing will be filled in from the usual defaults.
  3984. The optional @var{weight} is a number that adjusts the probability of selection
  3985. of the given side name set; it defaults to 1, and the probability is scaled
  3986. according to the sum of the weights for all the sides listed.
  3987. If any property value is a namer, then the namer will be run.
  3988. (Note that if multiple namers are specified, they cannot be guaranteed
  3989. to coordinate with each other, so you can end up with a side noun
  3990. that is inappropriate for its corresponding side name.)
  3991.  
  3992. @node Namers, Naming Methods, Naming Sides, Naming and Text Generation
  3993.  
  3994. @subsection Namers
  3995.  
  3996. Since one of the purposes of naming is to identify objects uniquely,
  3997. any name generator should be able to maintain some memory as to
  3998. what has been generated already.
  3999. The objects that do this are @dfn{namers}.
  4000.  
  4001. @deffn Form @code{namer} [symbol/id] method rejects@dots{}
  4002. This form defines an instance of a namer, with either the symbolic
  4003. name or numeric id.  If either matches the name or id of an existing
  4004. namer, then the old namer will be overwritten, otherwise a new one
  4005. will be created.
  4006. The @var{method} must be one of the naming methods listed below,
  4007. and @var{rejects} defines what names may not be produced (its exact
  4008. interpretation depends on the method).
  4009. @end deffn
  4010.  
  4011. @node Naming Methods,  , Namers, Naming and Text Generation
  4012.  
  4013. @subsection Naming Methods
  4014.  
  4015. As with general synthesis, @i{Xconq} has a number of @dfn{naming methods}
  4016. available.
  4017.  
  4018. An implementation is free to define additional naming methods.
  4019.  
  4020. @deffn NamingMethod @code{random} names...@dots{}
  4021. This method picks a name from the given list of names
  4022. and removes that name from the list 
  4023. @end deffn
  4024.  
  4025. @deffn NamingMethod @code{junky}
  4026. This method produces a gobbledy-gook name, very techy-looking.
  4027. @end deffn
  4028.  
  4029. @deffn NamingMethod @code{grammar} root max-length rules@dots{}
  4030. This method defines a grammar, where @var{root} is the root symbol,
  4031. @var{max-length} is a limit on the length of the generated names
  4032. (in characters),
  4033. and @var{rules} is a list of rules of the form
  4034. @example
  4035. (@var{symbol} ([sym] [weight] @var{symbol/string/list} [n] @dots{}))
  4036. @end example
  4037. @end deffn
  4038.  
  4039. The generation process works by substituting one of the rule's alternatives
  4040. for the symbol, starting with the root symbol.
  4041. The probability of an alternative being selected is arrived at by
  4042. adding up the optional weights @var{weight} (assuming missing weights
  4043. to be @code{1}), and choosing with a probability of the weight
  4044. divided by the total sum of weights.
  4045. Thus the weights need not add up to any particular value.
  4046.  
  4047. Strings get used directly.
  4048. If a symbol in the rule's chosen expansion does not appear as the 
  4049. lefthand side in any rule, then it will be handled as a string,
  4050. otherwise it will be expanded in turn.
  4051. If the symbol matches a namer's name, then that namer will be
  4052. run (passing the same object??) and its result incorporated.
  4053. A list should be a list of strings and symbols, and the expansion
  4054. of each will be concatenated.
  4055.  
  4056. @deffn GlobalConstant @code{any}
  4057. [???]
  4058. @end deffn
  4059.  
  4060. @deffn GlobalConstant @code{or}
  4061. @end deffn
  4062.  
  4063. @deffn GlobalConstant @code{reject}
  4064. A special rule headed by @code{reject} is a list of substrings
  4065. that should not appear in a generated name; this is a convenient
  4066. way to filter out particularly unlovely results.
  4067. @end deffn
  4068.  
  4069. @deffn GlobalConstant @code{capitalize}
  4070. Directs capitalization of a nonterminal.
  4071. @end deffn
  4072.  
  4073. [text is not actually different from a namer?]
  4074.  
  4075. @deffn Form @code{text} [symbol/id] method rejects@dots{}
  4076. @end deffn
  4077.  
  4078. [elsewhere?]
  4079. @deffn GlobalVariable @code{action-messages} patterns
  4080. @end deffn
  4081.  
  4082. @deffn GlobalVariable @code{event-messages} patterns
  4083. @end deffn
  4084.  
  4085. @node Actions, Backdrop Environment Parameters, Naming and Text Generation, Reference Manual
  4086.  
  4087. @section Actions
  4088.  
  4089. The parameters in this section define and regulate the various actions that are
  4090. available to units during a game.
  4091.  
  4092. Actions always start and complete (including all of their effects)
  4093. within the same turn, and a unit can only do one at a time.
  4094.  
  4095. All actions are potentially available to all units, but the parameters
  4096. can be set so as to deny any action type to any unit type.
  4097. See the descriptions with each action type.
  4098.  
  4099. All action is limited by action points.
  4100. Each unit gets a certain number at the beginning of each
  4101. turn and expends them in the course of doing things.
  4102. The usual expenditure is
  4103. one point per action, but may be more, as defined for each type of action.
  4104. A unit action must always consume at least one action point.
  4105. Units can accumulate acp from turn to turn, and they can also reduce
  4106. acp below zero.
  4107.  
  4108. @menu
  4109. * Actions in General::
  4110. * Action Ordering:: 
  4111. * Movement Action::
  4112. * Entry Action::
  4113. * Research Action::            
  4114. * Toolup Action::              
  4115. * Unit Creation Actions::       
  4116. * Unit Completion Action::
  4117. * Repair Action::
  4118. * Material Production Action::
  4119. * Material Transfer Action::
  4120. * Side Change Action::
  4121. * Disband Action::
  4122. * Part Transfer Action::
  4123. * Type Change Action::         
  4124. * Combat Actions::             
  4125. * Capture Action::             
  4126. * Detonation Action::
  4127. * Terrain Alteration Actions::
  4128. @end menu
  4129.  
  4130. @node Actions in General, Action Ordering, Actions, Actions
  4131.  
  4132. @subsection Actions in General
  4133.  
  4134. @deffn UnitTypeProperty @code{acp-per-turn} acp
  4135. This property is the basic allowance of action points that a unit gets each turn.
  4136. Defaults to @code{0}.
  4137. @end deffn
  4138.  
  4139. @deffn UnitTypeProperty @code{acp-min} acp
  4140. This property specifies how far into ``action debt'' a unit can go
  4141. during a turn before it is prevented entirely from acting.
  4142. A unit with acp < 1 at the beginning of a turn cannot do anything at all.
  4143. Defaults to @code{0}.
  4144. @end deffn
  4145.  
  4146. @deffn UnitTypeProperty @code{acp-max} acp
  4147. This property is
  4148. the maximum number of action points that a unit can save up.
  4149. The value @code{-1} means that @code{acp-max} is equal to @code{acp}.
  4150. Extra acp is silently lost.
  4151. Defaults to @code{-1}. 
  4152. @end deffn
  4153.  
  4154. @deffn UnitTypeProperty @code{free-acp} acp
  4155. This property is
  4156. the value is the amount by which the action points for some
  4157. action can exceed the unit's currently available acp
  4158. and still allow that action.
  4159. Defaults to @code{-1}, which means enough free acp to
  4160. allow any action.
  4161. @end deffn
  4162.  
  4163. Note that a unit with an acp of 0 is completely unintelligent, about like
  4164. a cow patty.  Cow patties can be useful for blocking paths, hiding behind,
  4165. and suchlike, and have the advantage that once they're in place, you don't
  4166. have to manage them.  Other units will have to pick them up and put them
  4167. down, of course.
  4168.  
  4169. @deffn Table @code{material-to-act} u m -> n
  4170. This table is a minimum amount of @var{m} needed for @var{u} to be able to act.
  4171. The material is not consumed.
  4172. Defaults to @code{0}.
  4173. @end deffn
  4174.  
  4175. @deffn UnitTypeProperty @code{acp-damage-effect} xxx
  4176. @end deffn
  4177.  
  4178. @deffn Table @code{acp-night-effect} u t -> n
  4179. This table is the multiplier for unit's acp at night in each type of terrain.
  4180. Defaults to @code{100}.
  4181. @end deffn
  4182.  
  4183. @deffn Table @code{acp-occupant-effect} u1 u2 -> n
  4184. Defaults to @code{100}.
  4185. @end deffn
  4186.  
  4187. @deffn UnitTypeProperty @code{acp-per-turn-min} acp
  4188. This property sets a lower limit on the effect of occupants,
  4189. damage, and other modifiers on the acp to be added at the beginning
  4190. of the turn.
  4191. Defaults to @code{0}.
  4192. @end deffn
  4193.  
  4194. @deffn UnitTypeProperty @code{acp-per-turn-max} acp
  4195. This property set the upper limit on the effect of occupants
  4196. and other modifiers to the acp added at the beginning of the turn.
  4197. Defaults to @code{-1}, which indicate no limit.
  4198. @end deffn
  4199.  
  4200. @node Action Ordering, Movement Action, Actions in General, Actions
  4201.  
  4202. @subsection Action Ordering
  4203.  
  4204. @deffn GlobalVariable @code{use-side-priority} t/f
  4205. This variable is @code{true} if the sides may only act one at a time;
  4206. otherwise, all sides and units may move simultaneously during a turn.
  4207. Defaults to @code{false}.
  4208. @end deffn
  4209.  
  4210. @deffn UnitTypeProperty @code{action-priority} n
  4211. This property is the order in which units of this type will act.
  4212. Higher numbers act earlier.
  4213. If the difference between the priority of one type and another
  4214. is greater than 100, then the earlier-acting units must finish acting
  4215. before the later-acting units, otherwise a player can rearrange the actual
  4216. acting order as desired.
  4217. Defaults to @code{0}.
  4218. @end deffn
  4219.  
  4220. @node Movement Action, Entry Action, Action Ordering, Actions
  4221.  
  4222. @subsection Movement Action
  4223.  
  4224. Movement is the most common sort of action.
  4225. This section covers movement over open terrain;
  4226. the next section discusses interaction with transports.
  4227.  
  4228. The general theory of movement is that a unit not in a transport
  4229. crosses its current cell terrain to the edge of the cell,
  4230. crosses any border terrain, and then moves into the destination cell,
  4231. OR it moves onto connection terrain,
  4232. travels along connection terrain to the new cell, and maybe 
  4233. moves off the connection.
  4234. If the unit starts in a transport, then the transport may ferry
  4235. the unit over some of the intervening terrain,
  4236. possibly as far as the unit's destination.
  4237.  
  4238. A unit's basic movement rate is defined by its @dfn{speed},
  4239. which is a ratio of the the unit's acp.
  4240. A speed of 100% means that the unit can potentially
  4241. enter as many cells as it has acp,
  4242. while a speed of 20% means that the unit uses at least
  4243. 5 acp to enter a cell.
  4244.  
  4245. Movement can only succeed if several conditions are met:
  4246. the unit must be able to cross
  4247. the border terrain, the destination must be inside the world (but see below),
  4248. it must be able to exist on the terrain of the destination.
  4249.  
  4250. @deffn ActionType @code{move} x y z
  4251. This is the action that a unit performs to go from one location to another.
  4252. The destination must be within the @code{move-range} of the unit.
  4253. @end deffn
  4254.  
  4255. @deffn UnitTypeProperty @code{acp-to-move} acp
  4256. This property is the number of acp a unit uses to do one move action.
  4257. Defaults to @code{1}.
  4258. @end deffn
  4259.  
  4260. @deffn UnitTypeProperty @code{speed} n
  4261. This property is the basic multiplier relating acp to the number
  4262. of cells that may be entered during a turn.
  4263. Defaults to @code{100}.
  4264. @end deffn
  4265.  
  4266. @deffn UnitTypeProperty @code{speed-damage-effect} list@dots{}
  4267. Defaults to @code{()}.
  4268. @end deffn
  4269.  
  4270. @deffn Table @code{speed-occupant-effect} u1 u2 -> n%
  4271. This table is the percent change in the speed
  4272. of type @var{u1} for each occupant of type @var{u2}.
  4273. If the basic speed of @var{u1} is @code{0},
  4274. then the multiplication is performed
  4275. as if the speed were @code{1} instead.
  4276. Defaults to @code{100}.
  4277. @end deffn
  4278.  
  4279. @deffn UnitTypeProperty @code{speed-wind-effect} xxx
  4280. @end deffn
  4281.  
  4282. @deffn UnitTypeProperty @code{speed-wind-angle-effect} xxx
  4283. @end deffn
  4284.  
  4285. @deffn UnitTypeProperty @code{speed-min} mp
  4286. This property is the worst-case speed of a unit.
  4287. Defaults to @code{0}.
  4288. @end deffn
  4289.  
  4290. @deffn UnitTypeProperty @code{speed-max} mp
  4291. This property is the upper bound on a unit's movement in one turn.
  4292. Defaults to @code{0}.
  4293. @end deffn
  4294.  
  4295. @deffn UnitTypeProperty @code{move-range} n
  4296. This property is the maximum distance allowed to the destination cell.
  4297. Defaults to @code{1}.
  4298. @end deffn
  4299.  
  4300. The product of a unit's acp and its speed is its available @dfn{movement points}.
  4301. Any move between cells will cost at least one movement point.
  4302. Some mp costs may be negative, but the total mp for a move will always
  4303. be at least 1.
  4304.  
  4305. @deffn Table @code{mp-to-leave-terrain} u t -> mp
  4306. This table is the mp cost to leave a cell of type @var{t}.
  4307. If @var{t} is a border type, this cost is never used.
  4308. If @var{t} is a connection type, this cost is the cost of leaving the
  4309. connection terrain for the open terrain of the cell.
  4310. If @var{t} is a coating type, then this value adds to the cost
  4311. of leaving the cell.
  4312. Defaults to @code{0}.
  4313. @end deffn
  4314.  
  4315. @deffn Table @code{mp-to-enter-terrain} u t -> mp
  4316. This table is the mp cost to enter a cell of type @var{t}.
  4317. If @var{t} is a border type, this cost is the
  4318. cost of crossing the border.
  4319. If @var{t} is a connection type, this cost is the cost of entering the
  4320. connection terrain from the open terrain of the cell.
  4321. If @var{t} is a coating type, then this value adds to the cost
  4322. of entering the cell.
  4323. Defaults to @code{1}.
  4324. @end deffn
  4325.  
  4326. @deffn Table @code{mp-to-traverse} u t -> mp
  4327. This table gives the cost to travel
  4328. along a connection or border of the given type.
  4329. (note that the other costs are irrelevant if
  4330. unit starts and ends its movement on the connection).
  4331.  
  4332. A special type of move known as a @dfn{border slide} can occur when the
  4333. endpoints of a border touch on the start and destination cells.
  4334. Sliding works like normal movement
  4335. that happens to end up on a nonadjacent cell.
  4336. Same rules for permissibility apply.
  4337. If the value is negative, then border sliding is not possible.
  4338.  
  4339. Defaults to @code{1}.
  4340. @end deffn
  4341.  
  4342. If both enter/traverse/leave and enter/leave movement is possible,
  4343. then @i{Xconq} will automatically choose the cheapest alternative.
  4344.  
  4345. Each unit type has a range of altitudes within which it normally operates.
  4346.  
  4347. @deffn Table @code{altitude-min} u t -> n
  4348. This table is the minimum altitude possible for each type of unit
  4349. on each type of terrain.
  4350. Defaults to @code{0}.
  4351. @end deffn
  4352.  
  4353. @deffn Table @code{altitude-max} u t -> n
  4354. This table is the maximum altitude possible for each type of unit
  4355. on each type of terrain.
  4356. Defaults to @code{0}.
  4357. @end deffn
  4358.  
  4359. @deffn UnitTypeProperty @code{mp-to-leave-world} mp
  4360. This property is an additional move cost to leave the world entirely.
  4361. To leave, the unit must be within its @code{move-range} of an edge,
  4362. and have sufficient mp to move into the terrain in the edge cell
  4363. designated as the destination of the move.
  4364. If the value is @code{-1}, then the unit may never leave.
  4365. Defaults to @code{-1}.
  4366. @end deffn
  4367.  
  4368. @deffn UnitTypeProperty @code{free-mp} mp
  4369. This property is the amount by which the move points can ``go into the red''
  4370. and still allow one more move.
  4371. Defaults to @code{0}.
  4372. @end deffn
  4373.  
  4374. ZOC is exerted only over units out in the open, has no effect on occupants,
  4375. unless they leave their transport.
  4376. Occupants can themselves exert a ZOC,
  4377. if @code{occupant-can-fight} is true.
  4378. ZOC applies to all units on a hostile side.
  4379.  
  4380. @deffn Table @code{zoc-range} u1 u2 -> dist
  4381. This table is the maximum distance at which type @var{u1}
  4382. exerts a ZOC over type @var{u2}.
  4383. A value of @code{0} means that the unit controls only its own cell,
  4384. and a value of @code{-1} means that the unit does not exert a ZOC at all.
  4385. Defaults to @code{0}.
  4386. @end deffn
  4387.  
  4388. @deffn Table @code{zoc-into-terrain} u t -> t/f
  4389. This table is @code{true} if the unit exerts its ZOC into terrain @var{t}.
  4390. Defaults to @code{true}.
  4391. @end deffn
  4392.  
  4393. @deffn Table @code{zoc-from-terrain-effect} u t -> n
  4394. Defaults to @code{100}.
  4395. @end deffn
  4396.  
  4397. @deffn Table @code{mp-to-enter-zoc} u1 u2 -> mp
  4398. This table specifies extra movement points needed to enter the ZOC.
  4399. @code{-1} prevents entry entirely.
  4400. Defaults to @code{-1}.
  4401. @end deffn
  4402.  
  4403. @deffn Table @code{mp-to-leave-zoc} u1 u2 -> mp
  4404. This table specifies extra movement points needed to leave the ZOC.
  4405. @code{-1} prevents departure entirely.
  4406. Defaults to @code{0}.
  4407. @end deffn
  4408.  
  4409. @deffn Table @code{mp-to-traverse-zoc} u1 u2 -> mp
  4410. This table specifies extra movement points needed to move within the ZOC.
  4411. @code{-1} prevents traversing entirely.
  4412. Defaults to @code{0}.
  4413. @end deffn
  4414.  
  4415. If multiple units exert a ZOC into the same cell, then the mp cost
  4416. is the maximum of the different ZOC costs.
  4417.  
  4418. Units may use up some of their materials when they move.
  4419. Consumption happens after the move action, and only for successful moves.
  4420.  
  4421. @deffn Table @code{material-to-move} u m -> n
  4422. This table is the amount of each material that a unit of type @var{u}
  4423. must have in order to be able to move.
  4424. Defaults to @code{0}.
  4425. @end deffn
  4426.  
  4427. @deffn Table @code{consumption-per-move} u m -> n
  4428. This table is the amount of each material used by a unit to do one move action.
  4429. The amount taken is independent of terrain.
  4430. If the unit has less than the required amount of any of these materials,
  4431. it is immobilized until it gets more (this is tested before each move
  4432. action; note that this does not affect any other action, including
  4433. entering and leaving transports).
  4434. Defaults to @code{0}.
  4435. @end deffn
  4436.  
  4437. @node Entry Action, Research Action, Movement Action, Actions
  4438.  
  4439. @subsection Entry Action
  4440.  
  4441. Units can be inside other units, and have units inside them, in a
  4442. tree-like fashion.  There is no limit on the depth of the tree,
  4443. but most occupant-transport relationships have other limits.
  4444.  
  4445. @deffn ActionType @code{enter} unit
  4446. This is the action to enter the given @var{unit}.
  4447. @end deffn
  4448.  
  4449. @deffn UnitTypeProperty @code{acp-to-enter-unit} acp
  4450. This property is the number of acp a unit uses to do one entry action.
  4451. Defaults to @code{1}.
  4452. @end deffn
  4453.  
  4454. @deffn Table @code{can-enter-independent} u1 u2 -> t/f
  4455. This table is true if a unit @var{u1} can enter an independent unit @var{u2}.
  4456. Defaults to @code{false}.
  4457. @end deffn
  4458.  
  4459. Entering and leaving incur mp costs as does movment,
  4460. but units with a speed of 0 may enter and leave transports.
  4461.  
  4462. @deffn Table @code{mp-to-enter-unit} u1 u2 -> n
  4463. This table is the extra movement points required for @var{u1}
  4464. to enter the transport @var{u2},
  4465. and vice versa (i.e. how much of transport's time is consumed by the process).
  4466. Defaults to @code{0}.
  4467. @end deffn
  4468.  
  4469. @deffn Table @code{mp-to-leave-unit} u1 u2 -> n
  4470. Similar to entry cost.
  4471. Defaults to @code{0}.
  4472. @end deffn
  4473.  
  4474. Note that these mp consumptions need not be symmetrical
  4475. between occupant and transport,
  4476. so for instance a passenger can use 2 of its mp to get on a transport,
  4477. while costing the transport only one of its mp.
  4478.  
  4479. @deffn Table @code{ferry-on-entry} u1 u2 -> ferry-type
  4480. @end deffn
  4481. @deffn Table @code{ferry-on-departure} u1 u2 -> ferry-type
  4482. This table specifies how much intervening terrain the unit @var{u2}
  4483. entering or leaving transport @var{u1}
  4484. will have to cross on its own (and thus incur the terrain's mp costs and
  4485. limitations).
  4486. Defaults to @code{over-border}.
  4487. @end deffn
  4488.  
  4489. @deffn GlobalConstant @code{over-nothing}
  4490. This constant indicates no ferrying,
  4491. occupant must pay all costs to go to destination cell.
  4492. @end deffn
  4493.  
  4494. @deffn GlobalConstant @code{over-own}
  4495. This constant indicates that the transport ferries over terrain
  4496. of its own cell.
  4497. @end deffn
  4498.  
  4499. @deffn GlobalConstant @code{over-border}
  4500. This constant indicates that the transport ferries over any
  4501. border terrain also.
  4502. @end deffn
  4503.  
  4504. @deffn GlobalConstant @code{over-all}
  4505. This constant indicates that the transport ferries to destination cell,
  4506. effectively putting occupant on middle of cell,
  4507. on connection terrain if necessary.
  4508. @end deffn
  4509.  
  4510. @node Research Action, Toolup Action, Entry Action, Actions
  4511.  
  4512. @subsection Research Action
  4513.  
  4514. Research is an action performed by a unit with the sole effect
  4515. of increasing its side's tech level.
  4516. Research cannot be performed by independent units.
  4517.  
  4518. @deffn ActionType @code{research} u
  4519. This is the action of researching the unit type @var{u}.
  4520. If the action is valid, then the tech level of the side
  4521. will increase.
  4522. Unit types with any tech crossover will also have their tech
  4523. levels adjusted.
  4524. @end deffn
  4525.  
  4526. @deffn UnitTypeProperty @code{acp-to-research} acp
  4527. This property is the number of action points used up by one research action.
  4528. Defaults to @code{0}, which disallows research.
  4529. @end deffn
  4530.  
  4531. @deffn Table @code{tech-per-research} u1 u2 -> .01n
  4532. This table is the gain in tech level resulting from a research action, expressed as
  4533. 1/100 of a level.  Gains of less than 100 are probabilistic [should describe
  4534. this concept in general, used by several parms]
  4535. Defaults to @code{0}.
  4536. @end deffn
  4537.  
  4538. @deffn UnitTypeProperty @code{tech-per-turn-max} tl
  4539. This property is a ceiling on the total gain of tech level possible in one turn
  4540. for each side and this unit type.
  4541. Defaults to @code{9999}.
  4542. @end deffn
  4543.  
  4544. @node Toolup Action, Unit Creation Actions, Research Action, Actions
  4545.  
  4546. @subsection Toolup Action
  4547.  
  4548. There are several stages in the construction of a unit: tooling up,
  4549. creation, and completion.  Tooling up is where the building unit
  4550. prepares to build, creation is the step where the new unit comes into
  4551. existence, and completion is where the new unit is brought up to being
  4552. operational.
  4553.  
  4554. For the player, this is mostly automatic; if tooling must be
  4555. done first, a user command to build will generate the appropriate actions.
  4556.  
  4557. Once the technology has been achieved, a unit that intends to construct
  4558. other units may need to tool up.
  4559. This is expressed as @dfn{tool points} or @dfn{tp}.
  4560. Tool points start at zero, can be increased by tooling actions,
  4561. and may gradually decline (representing wear and tear on the equipment).
  4562.  
  4563. @deffn ActionType @code{toolup} u
  4564. This is the action of tooling up to build a unit of type @code{u}.
  4565. The result is an increase in the tp for the acting unit.
  4566. @end deffn
  4567.  
  4568. @deffn UnitTypeProperty @code{acp-to-toolup} acp
  4569. This property gives the number of acp needed to do a toolup action.
  4570. Defaults to @code{0}, which disallows tooling up.
  4571. @end deffn
  4572.  
  4573. @deffn Table @code{tp-per-toolup} u1 u2 -> tp
  4574. This table is the number of tp gained by one tooling action.
  4575. Defaults to @code{0}.
  4576. @end deffn
  4577.  
  4578. @deffn Table @code{tp-to-build} u1 u2 -> tp
  4579. This table is the number of toolup points needed before a unit of type @var{u1}
  4580. can create or build a unit of type @var{u2}.
  4581. Defaults to @code{0}.
  4582. @end deffn
  4583.  
  4584. @deffn Table @code{tp-max} u1 u2 -> tp
  4585. This table is the maximum possible tooling.
  4586. Defaults to @code{0}.
  4587. @end deffn
  4588.  
  4589. @deffn Table @code{tp-attrition} u1 u2 -> tp
  4590. This table is the number of .01 tool points automatically lost at
  4591. the end of each turn.
  4592. Defaults to @code{0}.
  4593. @end deffn
  4594.  
  4595. @deffn Table @code{tp-crossover} u1 u2 -> n%
  4596. This table is the effective number of tool points for @var{u2} that is
  4597. guaranteed to exist, expressed as a percentage of the tool
  4598. points for @var{u1}.
  4599. [copy tech-crossover description here]
  4600. Defaults to @code{0}.
  4601. @end deffn
  4602.  
  4603. @node Unit Creation Actions, Unit Completion Action, Toolup Action, Actions
  4604.  
  4605. @subsection Unit Creation Actions
  4606.  
  4607. When a constructing unit is tooled up, the build action creates a unit
  4608. immediately and puts it in its designated location, whether inside the
  4609. unit doing the building or somewhere nearby.  This new unit, however, is
  4610. incomplete, representing the keel of the ship or the surveyor's
  4611. lines for an airstrip.  Incomplete units are thus basically skeletons,
  4612. with some unit characteristics, but unable to move or act in any way.
  4613. They also cannot have any occupants, unless the occupants are of a type
  4614. that can complete the unit.  Those occupants do not derive any protection
  4615. or other advantages from occupying the incomplete unit, and they are not
  4616. affected by the @code{occupant-can-build} limitation. 
  4617.  
  4618. @deffn ActionType @code{create-in} u unit
  4619. This action creates a new unit of type @var{u} occupying the given
  4620. unit @var{unit}.
  4621. The unit @var{unit} must have room for the new unit.
  4622. @end deffn
  4623.  
  4624. @deffn ActionType @code{create-at} u x y z
  4625. This action creates a new unit of type @var{u} in the open at
  4626. @var{x,y,z}.
  4627. The cell must have room for this new unit.
  4628. @end deffn
  4629.  
  4630. @deffn Table @code{acp-to-create} u1 u2 -> acp
  4631. This table is the acp used by a unit of type @var{u1}
  4632. to create a a unit of type @var{u2}.
  4633. If zero, then @var{u1} cannot create a @var{u2}.
  4634. Defaults to @code{0}.
  4635. @end deffn
  4636.  
  4637. @deffn Table @code{create-range} u1 u2 -> dist
  4638. This table is the maximum distance at which a unit of type @var{u1}
  4639. can create a unit of type @var{u2}.
  4640. Defaults to @code{0}.
  4641. @end deffn
  4642.  
  4643. @deffn Table @code{cp-on-creation} u1 u2 -> cp
  4644. This table is the completeness of a unit of type @var{u2} when
  4645. created by a unit of type @var{u1}.
  4646. Defaults to @code{1}.
  4647. @end deffn
  4648.  
  4649. @deffn Table @code{material-to-create} u m -> n
  4650. This table is the total amount of a material type @var{m}
  4651. needed to create a unit of type @var{u}.
  4652. Defaults to @code{0}.
  4653. @end deffn
  4654.  
  4655. @deffn Table @code{consumption-on-creation} u m -> n
  4656. This table is the amount of a material type @var{m}
  4657. consumed to create a unit of type @var{u}.
  4658. Defaults to @code{0}.
  4659. @end deffn
  4660.  
  4661. @deffn Table @code{supply-on-creation} u m -> n
  4662. This table is the amount of supply of each material type @var{m}
  4663. to give a newly created unit of type @var{u}.
  4664. This supply is newly generated, does not come from anywhere else.
  4665. (Note that players could cheat by creating units, taking their supply,
  4666. and never completing them.)
  4667. Defaults to @code{0}.
  4668. @end deffn
  4669.  
  4670. @node Unit Completion Action, Repair Action, Unit Creation Actions, Actions
  4671.  
  4672. @subsection Unit Completion Action
  4673.  
  4674. Once an incomplete unit has been created,
  4675. other units can help to complete it.
  4676.  
  4677. @deffn ActionType @code{build} unit
  4678. This action adds to the completeness of @var{unit}.
  4679. If the unit becomes complete, it will be given its initial supply,
  4680. acp, name, etc.
  4681. @end deffn
  4682.  
  4683. @deffn Table @code{acp-to-build} u1 u2 -> acp
  4684. This table is the acp used up by one build action by a unit of type @var{u1}
  4685. when buiding a unit of type @var{u2}.
  4686. Defaults to @code{0}.
  4687. @end deffn
  4688.  
  4689. @deffn Table @code{cp-per-build} u1 u2 -> cp
  4690. This table is the amount of completeness of a unit of type @var{u2}
  4691. added by each completion action performed by a unit of type @var{u1}.
  4692. If @code{0}, then @var{u1} cannot contribute to completing @var{u2}.
  4693. Defaults to @code{1}.
  4694. @end deffn
  4695.  
  4696. @deffn Table @code{material-to-build} u m -> n
  4697. This table is the amount of each material type @var{m}
  4698. that @var{u} must have in order to build anything at all.
  4699. Defaults to @code{0}.
  4700. @end deffn
  4701.  
  4702. @deffn Table @code{consumption-per-build} u m -> n
  4703. This table is the amount of each material type @var{m}
  4704. consumed by @var{u} when doing a build action.
  4705. Defaults to @code{0}.
  4706. @end deffn
  4707.  
  4708. @deffn Table @code{build-range} u1 u2 -> dist
  4709. This table is the maximum distance allowed between a unit of type @var{u1}
  4710. and the incomplete unit of type @var{u2} it is working on.
  4711. Defaults to @code{0}, which requires the two units to be in
  4712. the same cell.
  4713. @end deffn
  4714.  
  4715. At a given point, incomplete units can make progress towards
  4716. completion on their own.  This is automatic because incomplete
  4717. units are unable to act, and occurs at a constant specified rate.
  4718.  
  4719. @deffn UnitTypeProperty @code{cp-to-self-build} cp
  4720. This property is the minimum completeness of the unit necessary before it
  4721. can work on itself.
  4722. Defaults to @code{0}.
  4723. @end deffn
  4724.  
  4725. @deffn UnitTypeProperty @code{cp-per-self-build} cp
  4726. This property is the completeness added each turn when a unit works on itself.
  4727. Defaults to @code{0}.
  4728. @end deffn
  4729.  
  4730. @deffn Table @code{supply-on-completion} u m -> n
  4731. This table is the minimum amount of supply of each material type @var{m}
  4732. guaranteed to a newly completed unit of type @var{u}.
  4733. If not already available to the unit, it will be newly generated.
  4734. Defaults to @code{0}.
  4735. @end deffn
  4736.  
  4737. @node Repair Action, Material Production Action, Unit Completion Action, Actions
  4738.  
  4739. @subsection Repair Action
  4740.  
  4741. Units can restore their own and each other's hp by doing repairs.
  4742. Repair requires a repair action.
  4743. The action points for this action
  4744. are taken from both the unit being repaired and
  4745. the repairer (using the same table @code{acp-to-repair}).
  4746. When a unit repairs itself, the action cost is counted once only.
  4747.  
  4748. @deffn ActionType @code{repair} unit
  4749. This is the action of repairing the given @var{unit}.
  4750. @end deffn
  4751.  
  4752. @deffn Table @code{acp-to-repair} u1 u2 -> acp
  4753. This table is the number of action points used up
  4754. by a unit of type @var{u1}
  4755. doing one repair action on a unit of type @var{u2}.
  4756. Defaults to @code{0}, which disallows the action.
  4757. @end deffn
  4758.  
  4759. @deffn Table @code{hp-per-repair} u1 u2 -> .01hp
  4760. This table is the hundredths of a hp that a single repair action
  4761. by a unit of type @var{u1} restores to a unit of type @var{u2}.
  4762. The fraction of this over 100 is added to hp directly,
  4763. while the < 100 fraction is added probabilistically.
  4764. (For example, a value of 160 means that 1 hp will be added for
  4765. each action, and there is a 60% chance that a second hp will
  4766. be added also.)
  4767. Defaults to @code{0}.
  4768. @end deffn
  4769.  
  4770. Materials may be needed and/or consumed during repair.
  4771. The materials will be taken from the
  4772. unit being repaired, then from the repairer.
  4773.  
  4774. @deffn Table @code{material-to-repair} u m -> .01n
  4775. This table is the amount of each material type @var{m} needed
  4776. for one repair action.
  4777. As with @code{hp-per-repair},
  4778. the < 100 part is average, and > 100 is guaranteed.
  4779. Defaults to @code{0}.
  4780. @end deffn
  4781.  
  4782. @deffn Table @code{consumption-per-repair} u m -> .01n
  4783. This table is the amount of each material type @var{m}
  4784. used up by a repair action.
  4785. @end deffn
  4786.  
  4787. The repairing unit must also not be too damaged itself to do repairs.
  4788.  
  4789. @deffn Table @code{hp-to-repair} u1 u2 -> hp
  4790. This table is the minimum hp level required of a unit of type @var{u1}
  4791. to repair a unit of type @var{u2}.
  4792. If less, then @var{u1} is too damaged to do any repairing.
  4793. Defaults to @code{1}, which allows repair always.
  4794. @end deffn
  4795.  
  4796. (The following are not really part of the repair action definition, since
  4797. they occur automatically.)
  4798.  
  4799. @deffn Table @code{auto-repair} u1 u2 -> .01hp
  4800. This table is the amount of repair (in 1/100 hp) that @var{u1} will do
  4801. on any unit of type @var{u2} within range (@code{auto-repair-range}).
  4802. As with @code{hp-per-repair},
  4803. the < 1.00 part is average, and > 1.00 is guaranteed.
  4804. Defaults to @code{0}, which disallows auto-repair.
  4805. @end deffn
  4806.  
  4807. @deffn Table @code{auto-repair-range} u1 u2 -> dist
  4808. This table is the distance out to which @var{u1} will auto-repair
  4809. any damaged @var{u2}.  A value of @code{0} requires the two units
  4810. to be in the same cell, while a value of @code{-1} means that
  4811. @var{u2} must be either an occupant or transport of @var{u1}.
  4812. Defaults to @code{0}.
  4813. @end deffn
  4814.  
  4815. @node Material Production Action, Material Transfer Action, Repair Action, Actions
  4816.  
  4817. @subsection Material Production Action
  4818.  
  4819. Units can produce materials by explicit action.
  4820.  
  4821. @deffn ActionType @code{produce} m
  4822. This action results in a quantity of material @var{m}
  4823. coming into existence.
  4824. @end deffn
  4825.  
  4826. @deffn Table @code{acp-to-produce} u m -> acp
  4827. This table is the acp used up by one @code{produce} action.
  4828. Defaults to @code{0}.
  4829. @end deffn
  4830.  
  4831. @deffn Table @code{material-per-production} u m -> n
  4832. This table is the amount of material produced by @var{u}
  4833. when acting to produce type @var{m}.
  4834. Defaults to @code{0}.
  4835. @end deffn
  4836.  
  4837. @deffn Table @code{material-to-produce} u m -> .01n
  4838. @end deffn
  4839.  
  4840. @node Material Transfer Action, Side Change Action, Material Production Action, Actions
  4841.  
  4842. @subsection Material Transfer Action
  4843.  
  4844. Although most movement of materials between units happens automatically
  4845. (see backdrop economy description, section xxx),
  4846. players can also do it explicitly.
  4847. Players can both take materials from other units, and give a unit's
  4848. materials to others.
  4849.  
  4850. @deffn ActionType @code{transfer} unit m n
  4851. This is the action of transferring supply to the given unit @var{unit}.
  4852. The desired amount is @var{n};  if @var{m} is a valid material type,
  4853. then only that type will be transferred, otherwise the action will
  4854. transfer all types of materials possible.
  4855. The actual transfer amounts may be less than @var{n}.
  4856. [If @var{unit} is NULL, then is equiv to discarding material?]
  4857. @end deffn
  4858.  
  4859. @deffn Table @code{acp-to-unload} u1 m -> acp
  4860. @end deffn
  4861. @deffn Table @code{acp-to-load} u1 m -> acp
  4862. These tables are the number of action points used up by one material transfer
  4863. action from @var{u1} to @var{u2}.
  4864. The amount is independent of the material type being transferred.
  4865. If either value is @code{0}, then the material cannot be transferred.
  4866. Defaults to @code{0}.
  4867. @end deffn
  4868.  
  4869. @deffn Table @code{unload-max} u1 m -> n
  4870. @end deffn
  4871. @deffn Table @code{load-max} u2 m -> n
  4872. These two tables determine how much of material @var{m} can be transferred out
  4873. of a unit of type @var{u1} and into one of type @var{u2}
  4874. in one transfer action.
  4875. The actual quantity transferred by the action
  4876. is the minimum of these two values.
  4877. A value of @code{0} disallows manual transfer.
  4878. Both default to @code{-1}, which allows any amount to be transferred.
  4879. @end deffn
  4880.  
  4881. @node Side Change Action, Disband Action, Material Transfer Action, Actions
  4882.  
  4883. @subsection Side Change Action
  4884.  
  4885. @deffn ActionType @code{change-side} side
  4886. This is the action of changing the actee's side to @var{side}.
  4887. The @var{side} can be any allowable side, and the actee
  4888. may be any unit controlled by the actor's side.
  4889. @end deffn
  4890.  
  4891. @deffn UnitTypeProperty @code{acp-to-change-side} acp
  4892. If the value of this property is greater than 0,
  4893. then this type of unit can be ordered to change to another given side.
  4894. The type must also be allowed to be on the new side.
  4895. Defaults to @code{0}.
  4896. @end deffn
  4897.  
  4898. @node Disband Action, Part Transfer Action, Side Change Action, Actions
  4899.  
  4900. @subsection Disband Action
  4901.  
  4902. Disbanding is the voluntary and controlled destruction of a unit,
  4903. performed by the unit itself or another unit.
  4904. A disbanded unit always vanishes, rather than changing to its
  4905. @code{wrecked-type}.
  4906.  
  4907. @deffn ActionType @code{disband} unit
  4908. This is the action of removing hp from @var{unit}.
  4909. The unit will vanish if all its hit points are gone.
  4910. @end deffn
  4911.  
  4912. @deffn Table @code{acp-to-disband} u1 u2 -> acp
  4913. This table is the number of action points used by the unit @var{u1} 
  4914. to do a disband action on unit @var{u2}.
  4915. Defaults to @code{0}.
  4916. @end deffn
  4917.  
  4918. @deffn UnitTypeProperty @code{hp-per-disband} hp
  4919. This table is the number of hp lost in a disband action.
  4920. Defaults to @code{0}, which disallows disbanding.
  4921. @end deffn
  4922.  
  4923. A disbanded unit can be scavenged for materials.
  4924.  
  4925. @deffn Table @code{supply-per-disband} u m -> n%
  4926. This table is the percentage of the unit's supply that is recovered
  4927. from a single disband action.
  4928. If the value is zero, then the unit's supply will not be
  4929. recovered by the disbanding process, and be lost permanently.
  4930. If any supply remains when the unit's hp is 0, then that
  4931. supply will be lost also.
  4932. Defaults to @code{100}, which means that the entire supply
  4933. will be recovered on the first disband action.
  4934. @end deffn
  4935.  
  4936. Note that if an essential supply is 100% recovered before the unit
  4937. is completely disbanded, then it may die from starvation first.
  4938. A partly-disbanded unit may still acquire supply
  4939. from nearby units, via the backdrop economy.
  4940.  
  4941. @deffn Table @code{recycleable-material} u m -> n
  4942. This table is the quantity of each type of material that becomes available
  4943. when a unit is completely disbanded.
  4944. The materials go to transports, occupants, and nearby units, in that order.
  4945. Any materials exceeding capacities of these units will be discarded.
  4946. These materials become available only when the unit vanishes.
  4947. Defaults to @code{0}.
  4948. @end deffn
  4949.  
  4950. @node Part Transfer Action, Type Change Action, Disband Action, Actions
  4951.  
  4952. @subsection Part Transfer Action
  4953.  
  4954. Units of variable size can transfer parts of themselves to other
  4955. units, or create a new unit.
  4956.  
  4957. @deffn ActionType @code{transfer-part} n unit
  4958. This action moves @var{n} parts of the actee to @var{unit},
  4959. or creates a new unit if @var{unit} is omitted.
  4960. If @var{n} is negative, this takes from @var{unit} instead.
  4961. If the action takes all the parts of any involved unit,
  4962. then it vanishes.
  4963. @end deffn
  4964.  
  4965. @deffn UnitTypeProperty @code{acp-to-transfer-part} acp
  4966. Defaults to @code{0}.
  4967. @end deffn
  4968.  
  4969. @node Type Change Action, Combat Actions, Part Transfer Action, Actions
  4970.  
  4971. @subsection Type Change Action
  4972.  
  4973. @deffn ActionType @code{change-type} u
  4974. @end deffn
  4975.  
  4976. @deffn Table @code{acp-to-change-type} u1 u2 -> acp
  4977. Defaults to @code{0}.
  4978. @end deffn
  4979.  
  4980. @deffn Table @code{material-to-change-type} u m -> n
  4981. Defaults to @code{0}.
  4982. @end deffn
  4983.  
  4984. @node Combat Actions, Capture Action, Type Change Action, Actions
  4985.  
  4986. @subsection Combat Actions
  4987.  
  4988. @i{Xconq} combat is somewhat abstract; the attacking player decides what sort
  4989. of attack to mount and perhaps when to retreat, but all else happens
  4990. automatically.
  4991.  
  4992. Combat may last longer than a single action;
  4993. it is then called a @dfn{battle} and divided into @dfn{rounds}.
  4994. The battle exists until one participant has a commitment of zero.
  4995. Units in a battle need not attack, and no damage will occur if none do so,
  4996. but they cannot move away until no longer committed.
  4997.  
  4998. The attacker/defender distinction applies only to a single action.
  4999.  
  5000. @deffn ActionType @code{attack} unit [commitment]
  5001. This action is a direct attack on the given @var{unit}.
  5002. The @var{unit} must be known to the attacking unit's side.
  5003. @end deffn
  5004.  
  5005. @deffn ActionType @code{overrun} x y z [commitment]
  5006. Overruns are a sort of combined attack/capture/move action.
  5007. The basic theory of an overrun is that the actor will attack,
  5008. capture, or co-occupy the given destination.
  5009. The exact effects depend on the types and sides of units in the destination.
  5010. @end deffn
  5011.  
  5012. @deffn Table @code{acp-to-attack} u1 u2 -> acp
  5013. This table is the number of action points used up by the attacker.
  5014. Defaults to @code{1}.
  5015. @end deffn
  5016.  
  5017. @deffn Table @code{acp-to-defend} u1 u2 -> acp
  5018. This table is the number of action points used up by the defender.
  5019. Defaults to @code{1}.
  5020. @end deffn
  5021.  
  5022. @deffn Table @code{attack-range-min} u1 u2 -> dist
  5023. This table is the minimum distance at which a unit can attack another.
  5024. Defaults to @code{0}.
  5025. @end deffn
  5026.  
  5027. @deffn Table @code{attack-range} u1 u2 -> dist
  5028. This table is the maximum distance at which a unit can attack another.
  5029. Defaults to @code{1}.
  5030. @end deffn
  5031.  
  5032. One round of combat consists of an attack, a reaction,
  5033. and a calculation of effects.
  5034.  
  5035. The defender's reaction is completely automatic, and occurs as part of the
  5036. attack action.  The defender's side does not get a chance to
  5037. decide what to do until the next round,
  5038. although doctrine can constrain the randomness somewhat.
  5039.  
  5040. @deffn Table @code{surrender-chance-per-attack} u1 u2 -> n%
  5041. This table is the chance that @var{u2} will surrender to @var{u1}
  5042. immediately upon being attacked.
  5043. Defaults to @code{0}.
  5044. @end deffn
  5045.  
  5046. @deffn Table @code{withdraw-chance-per-attack} u1 u2 -> n%
  5047. This table is the chance that @var{u2} will retreat from @var{u1}
  5048. immediately upon being attacked.
  5049. Defaults to @code{0}.
  5050. @end deffn
  5051.  
  5052. @deffn Table @code{acp-for-retreat} u1 u2 -> acp
  5053. This table is the extra acp that @var{u2} can get in order
  5054. to make a withdrawal possible.
  5055. Defaults to @code{0}.
  5056. @end deffn
  5057.  
  5058. In an overrun action,
  5059. if all the defending units are destroyed,
  5060. the attacker has sufficient acp and mp,
  5061. and the destination is safe to enter,
  5062. then the attacker can move into the defenders' cell.
  5063.  
  5064. Firing is a kind of attack that can take place at a distance,
  5065. involves no commitment or counterattack,
  5066. and for which the type of ammo may be selected.
  5067.  
  5068. @deffn ActionType @code{fire-at} unit [m]
  5069. This is the action of firing at a given @var{unit}.
  5070. If @var{m} is given, then that type will be used as ammo,
  5071. otherwise all available types will be used together.
  5072. @end deffn
  5073.  
  5074. @deffn ActionType @code{fire-into} x y [z] [m]
  5075. This is the action of firing into the cell at @var{x,y}.
  5076. If @var{z} is given, then the fire will be concentrated
  5077. on units at that elevation.
  5078. If @var{m} is given, then that type will be used as ammo,
  5079. otherwise all available types will be used together.
  5080. @end deffn
  5081.  
  5082. @deffn UnitTypeProperty @code{acp-to-fire} acp
  5083. If this property is greater than 0, this type may attack by firing.
  5084. Defaults to @code{0}.
  5085. @end deffn
  5086.  
  5087. @deffn Table @code{acp-to-be-fired-on} u1 u2 -> acp
  5088. This table is the acp lost when a unit is being fired upon.
  5089. Defaults to @code{1}.
  5090. @end deffn
  5091.  
  5092. @deffn UnitTypeProperty @code{range} dist
  5093. This property is the maximum distance to which a unit can fire.
  5094. Defaults to @code{1}.
  5095. @end deffn
  5096.  
  5097. @deffn UnitTypeProperty @code{range-min} dist
  5098. This property is the minimum distance to which a unit can fire.
  5099. Defaults to @code{0}.
  5100. @end deffn
  5101.  
  5102. @deffn UnitTypeProperty @code{elevation-at-max-range} dist
  5103. [elaborate calc to interpolate while rising and falling, basically
  5104. approximating a parabola]
  5105. @end deffn
  5106.  
  5107. Both attack and fire combat calculate hits and damage in the same way.
  5108.  
  5109. @deffn Table @code{hit-chance} u1 u2 -> n%
  5110. This table is the basic chance that a unit of type @var{u1} will
  5111. actually hit a unit of type @var{u2}.
  5112. If the hit chance is @code{0}, then the unit may never attack
  5113. or fire at a unit of that type.
  5114. Defaults to @code{0}.
  5115. @end deffn
  5116.  
  5117. @deffn Table @code{attack-terrain-effect} u1 t -> n%
  5118. @end deffn
  5119. @deffn Table @code{defend-terrain-effect} u2 t -> n%
  5120. These tables specify the
  5121. effect of attacker's and defender's respective terrains on
  5122. @code{hit-chance}.
  5123. These chances are multiplied with the basic hit chance.
  5124. Default to @code{100}.
  5125. @end deffn
  5126.  
  5127. @deffn Table @code{hit-cxp-effect} u1 u2 -> n
  5128. This table is the effect of combat experience on hit chance.
  5129. Its value is interpolated according to actual experience
  5130. (so that @var{n} is the effect when @var{u1} is at its maximum
  5131. experience), then multiplied with the hit chance.
  5132. Defaults to @code{100}.
  5133. @end deffn
  5134.  
  5135. @deffn Table @code{hit-falloff-range} u1 u2 -> n
  5136. This table is the maximum range at which the effectiveness of combat
  5137. is @i{not} affected by distance.
  5138. Defaults to @code{1}.
  5139. @end deffn
  5140.  
  5141. @deffn Table @code{hit-at-max-range-effect} u1 u2 -> n%
  5142. This is the multiplier for the effectiveness of combat at the
  5143. maximum range possible.
  5144. Defaults to @code{100}.
  5145. @end deffn
  5146.  
  5147. @deffn Table @code{damage} u1 u2 -> hp
  5148. This table is the basic amount of damage caused by a successful attack.
  5149. The value is a ``dice spec'' [explain somewhere]
  5150. Defaults to @code{1}.
  5151. @end deffn
  5152.  
  5153. The damage in an attack is always prorated by commitment;
  5154. the table value is for attacks at full commitment.
  5155.  
  5156. @deffn Table @code{damage-cxp-effect} u1 u2 -> n
  5157. This table is the effect of combat experience on damage.
  5158. Its value is interpolated according to actual experience
  5159. (so that @var{n} is the effect when @var{u1} is at its maximum
  5160. experience), then multiplied with both the dice size and the
  5161. addend of the damage spec.
  5162. Defaults to @code{100}.
  5163. @end deffn
  5164.  
  5165. @deffn Table @code{hp-min} u1 u2 -> hp
  5166. This table is the lowest hp possible for @var{u1} from attacks by @var{u2}.
  5167. Further attacks by @var{u2} are still valid, but have no effect.
  5168. Defaults to @code{0}.
  5169. @end deffn
  5170.  
  5171. You can set a unit to use a material as ammo.
  5172.  
  5173. @deffn Table @code{consumption-per-attack} u1 m -> n
  5174. @end deffn
  5175. @deffn Table @code{hit-by} u2 m -> n
  5176. These tables specify material consumption in combat.
  5177. For each material @code{m}, the min of these two values is the amount
  5178. of u1's supply used up in an attack on u2.
  5179. Both default to @code{0}.
  5180. @end deffn
  5181.  
  5182. @deffn Table @code{material-to-fight} u m -> n
  5183. This table is a minimum of each material that is necessary to either
  5184. attack or defend.
  5185. Defaults to @code{0}.
  5186. @end deffn
  5187.  
  5188. Transports can protect their occupants, and vice versa.
  5189.  
  5190. @deffn Table @code{protection} u1 u2 -> n%
  5191. @end deffn
  5192.  
  5193. Transport's destruction may leave occupants stranded on hex,
  5194. will do some sort of auto-escape or die if terrain is hostile.
  5195. [use ferry-on-leave to decide]
  5196.  
  5197. @deffn Table @code{stack-protection} u1 u2 -> n%
  5198. @end deffn
  5199.  
  5200. Several other side-effects of combat may also be defined.
  5201.  
  5202. @deffn Table @code{retreat-chance} u1 u2 -> n%
  5203. This table is the chance that @var{u2} will retreat if hit by @var{u1}.
  5204. Defaults to @code{0}.
  5205. @end deffn
  5206.  
  5207. @deffn Table @code{cxp-per-combat} u1 u2 -> cxp
  5208. This table is the number of combat experience points gained by @var{u1} 
  5209. by surviving a combat round with @var{u2}.
  5210. This applies equally to attackers and defenders.
  5211. Defaults to @code{0}.
  5212. @end deffn
  5213.  
  5214. @node Capture Action, Detonation Action, Combat Actions, Actions
  5215.  
  5216. @subsection Capture Action
  5217.  
  5218. A unit may attempt to capture another unit directly.
  5219. This means that the unit's side changes to that of the capturing unit.
  5220.  
  5221. @deffn ActionType @code{capture} unit
  5222. This is the action of capturing the given @var{unit}.
  5223. @end deffn
  5224.  
  5225. @deffn Table @code{acp-to-capture} u1 u2 -> acp
  5226. This table is the number of acp used up by a @code{capture} action.
  5227. Defaults to @code{0}, which disallows capture.
  5228. @end deffn
  5229.  
  5230. @deffn Table @code{capture-chance} u1 u2 -> n%
  5231. This table is the basic chance for @var{u1} to capture @var{u2}.
  5232. Defaults to @code{0}.
  5233. @end deffn
  5234.  
  5235. @deffn Table @code{independent-capture-chance} u1 u2 -> n%
  5236. This table is the basic chance for @var{u1} to capture an independent unit 
  5237. of type @var{u2}.  If the value is @code{-1}, then the chance of capture
  5238. is given by the @code{capture-chance}.
  5239. Defaults to @code{-1}.
  5240. @end deffn
  5241.  
  5242. @deffn Table @code{scuttle-chance} u t -> n%
  5243. This table is the chance that a unit whose capture is guaranteed will destroy
  5244. itself instead.  Scuttling is destructive, so unit changes to @code{wrecked-type}.
  5245. Occupants of an about-to-be-captured unit will also attempt to scuttle.
  5246. Defaults to @code{0}.
  5247. @end deffn
  5248.  
  5249. @deffn Table @code{occupant-escape-chance} u1 u2 -> n%
  5250. This table is the chance that an occupant @var{u1} will escape during the capture
  5251. of a unit of type @var{u2}.
  5252. Occupants that do not escape are either captured themselves or destroyed,
  5253. depending on their type and the capturing unit's side.
  5254. Defaults to @code{0}.
  5255. @end deffn
  5256.  
  5257. @deffn Table @code{hp-to-garrison} u1 u2 -> n
  5258. This table is the number of hp that will be taken from the capturing
  5259. unit @var{u1} in order to guard a captured @var{u2}.
  5260. If the amount is the unit's full hp, then the unit will vanish
  5261. and any occupants will be distributed to the captured unit, to open
  5262. terrain, or will vanish themselves if there is no other option.
  5263. Defaults to @code{0}.
  5264. @end deffn
  5265.  
  5266. @c @deffn Word {@var{bool unit2 unit @code{bridge}}}
  5267. @c True if the unit type @var{unit2} can be captured by another unit
  5268. @c @var{unit}, even across
  5269. @c impassable terrain.
  5270. @c @end deffn
  5271.  
  5272. @deffn Table @code{cxp-per-capture} u1 u2 -> ep
  5273. This table is the number of combat experience points gained by @var{u1} 
  5274. by capturing @var{u2}.
  5275. Defaults to @code{0}.
  5276. @end deffn
  5277.  
  5278. @deffn UnitTypeProperty @code{cxp-on-capture-effect} n
  5279. This property gives the change in a unit's cxp due to being captured,
  5280. expressed as a multiplier.
  5281. Defaults to @code{100}.
  5282. @end deffn
  5283.  
  5284. @node Detonation Action, Terrain Alteration Actions, Capture Action, Actions
  5285.  
  5286. @subsection Detonation Action
  5287.  
  5288. Detonation is an action and/or behavior that causes damage indiscriminately.
  5289. The action specifies the location of the detonation,
  5290. which may be in the unit's cell or an adjacent one.
  5291. A unit that detonates loses hp, changing to its @code{wrecked-type}
  5292. if it loses all of its hp.
  5293. It also hits every unit within a specified radius.
  5294. Detonation may also affect terrain within a specified radius.
  5295.  
  5296. @deffn ActionType @code{detonate} x y z
  5297. This action detonates the actee at the given location @var{x,y,z}.
  5298. @end deffn
  5299.  
  5300. @deffn UnitTypeProperty @code{acp-to-detonate} acp
  5301. This property is the number of action points used by one detonate action.
  5302. Defaults to @code{0}, which disallows detonation.
  5303. @end deffn
  5304.  
  5305. @deffn UnitTypeProperty @code{hp-per-detonation} hp
  5306. This property is the number of hp lost in each detonation.
  5307. Defaults to @code{0}.
  5308. @end deffn
  5309.  
  5310. @deffn Table @code{detonation-unit-range} u1 u2 -> dist
  5311. This table gives the range of effect from detonation of @var{u1}.
  5312. The severity falls off according to the inverse square law
  5313. extrapolated from the adjacent cell damage.
  5314. (1/4 severity at range 2, 1/9 at 3, etc.)
  5315. Defaults to @code{0}.
  5316. @end deffn
  5317.  
  5318. @deffn Table @code{detonation-damage-at} u1 u2 -> hp
  5319. This table is the severity of @var{u1}'s hit on a unit @var{u2} in the same cell.
  5320. Defaults to @code{0}.
  5321. @end deffn
  5322.  
  5323. @deffn Table @code{detonation-damage-adjacent} u1 u2 -> hp
  5324. This table is the severity of @var{u1}'s hit on a unit @var{u2} in an adjacent cell.
  5325. Defaults to @code{0}.
  5326. @end deffn
  5327.  
  5328. @deffn Table @code{detonation-terrain-range} u t -> dist
  5329. Defaults to @code{0}.
  5330. @end deffn
  5331.  
  5332. @deffn Table @code{detonation-terrain-damage-chance} u t -> n%
  5333. Defaults to @code{0}.
  5334. @end deffn
  5335.  
  5336. @deffn Table @code{terrain-damaged-type} t1 t2 -> n
  5337. Relative chance that terrain of type @var{t1} damaged by a detonation
  5338. will change into another type @var{t2}.
  5339. Defaults to @code{0}.
  5340. @end deffn
  5341.  
  5342. The following tables and properties can be used for units that cannot
  5343. detonate deliberately by doing a detonate action.
  5344.  
  5345. @deffn Table @code{detonate-on-hit} u1 u2 -> n%
  5346. This table is the chance that a hit on @var{u1}
  5347. by a unit of type @var{u2} will cause it to detonate (once).
  5348. Noncombat reductions in hp, such as attrition, have no effect.
  5349. Defaults to @code{0}.
  5350. @end deffn
  5351.  
  5352. @deffn UnitTypeProperty @code{detonate-on-death} n%
  5353. This property is the chance that if this type is about to die from a combat hit,
  5354. it will detonate first.
  5355. Defaults to @code{0}.
  5356. @end deffn
  5357.  
  5358. @deffn Table @code{detonate-on-capture} u1 u2 -> n%
  5359. This table is the chance that a unit of type @var{u1} will detonate if a capture
  5360. by a unit of type @var{u2} is about to succeed.
  5361. Defaults to @code{0}.
  5362. @end deffn
  5363.  
  5364. @deffn Table @code{detonate-on-approach-range} u1 u2 -> dist
  5365. When a unit of type @var{u2} on a non-trusted [?] side
  5366. appears at a distance of @var{dist}
  5367. or less, then @var{u1} will detonate.
  5368. If @code{-1}, then unit will not detonate upon approach.
  5369. Defaults to @code{-1}.
  5370. @end deffn
  5371.  
  5372. @deffn Table @code{detonation-accident-chance} u t -> n.f%
  5373. This table is the chance that the unit will detonate spontaneously.
  5374. This is checked once/turn, at the beginning of the turn, and also
  5375. upon each entry to a cell, if moving.
  5376. Defaults to @code{0}.
  5377. @end deffn
  5378.  
  5379. @node Terrain Alteration Actions,  , Detonation Action, Actions
  5380.  
  5381. @subsection Terrain Alteration Actions
  5382.  
  5383. @deffn ActionType @code{alter-terrain} x y t
  5384. This action changes the type of the cell at @var{x,y} to @var{t}.
  5385. @end deffn
  5386.  
  5387. @deffn ActionType @code{add-terrain} x y dir t
  5388. This action adds a connection or border of type @var{t}
  5389. to the cell at @var{x,y}, in direction @var{dir}.
  5390. @end deffn
  5391.  
  5392. @deffn ActionType @code{remove-terrain} x y dir t
  5393. This action removes a connection or border of type @var{t}
  5394. to the cell at @var{x,y}, in direction @var{dir}.
  5395. @end deffn
  5396.  
  5397. @deffn Table @code{acp-to-add-terrain} u t -> n
  5398. @end deffn
  5399. @deffn Table @code{acp-to-remove-terrain} u t -> n
  5400. For auxiliary terrain types, these tables are the costs to add or remove.
  5401. For cell terrain, the costs of removing the old type and adding the
  5402. new type are added together.
  5403. @end deffn
  5404.  
  5405. @deffn Table @code{alter-terrain-range} u t -> n
  5406. This table is the maximum distance at which a unit can alter terrain @var{t}.
  5407. Defaults to @code{0}, which means that the unit can change only the
  5408. terrain in its own cell.
  5409. @end deffn
  5410.  
  5411. At present, all sides that have seen the terrain once will be informed
  5412. about any changes.
  5413.  
  5414. @node Backdrop Environment Parameters, Backdrop Economy Parameters, Actions, Reference Manual
  5415.  
  5416. @section Backdrop Environment Parameters
  5417.  
  5418. This section describes how to set up backdrop computations.
  5419.  
  5420. @menu
  5421. * Random Environmental Variation::           
  5422. * Years and Days::              
  5423. * Seasonal Effects::  
  5424. * Weather Parameters::          
  5425. @end menu
  5426.  
  5427. @node Random Environmental Variation, Years and Days, Backdrop Environment Parameters, Backdrop Environment Parameters
  5428.  
  5429. @subsection Random Environmental Variation
  5430.  
  5431. Environmental conditions may be computed randomly.
  5432.  
  5433. @deffn TerrainTypeProperty @code{temperature-average} n
  5434. This property is the average temperature for each type of terrain.
  5435. Defaults to @code{0}.
  5436. @end deffn
  5437.  
  5438. @deffn TerrainTypeProperty @code{temperature-variability} n
  5439. This property is the amount of totally random variation
  5440. in the temperature in each cell.
  5441. Defaults to @code{0}.
  5442. @end deffn
  5443.  
  5444. @deffn TerrainTypeProperty @code{wind-force-average}
  5445. @end deffn
  5446.  
  5447. @deffn TerrainTypeProperty @code{wind-force-variability}
  5448. @end deffn
  5449.  
  5450. @deffn TerrainTypeProperty @code{wind-variability}
  5451. @end deffn
  5452.  
  5453. @deffn GlobalVariable @code{wind-mix-range}
  5454. This variable is the radius out to which winds interact.
  5455. If 0, then winds in adjacent cells can vary independently
  5456. of each other, and do not interact in any way.
  5457. Defaults to @code{0}.
  5458. @end deffn
  5459.  
  5460. @node Years and Days, Seasonal Effects, Random Environmental Variation, Backdrop Environment Parameters
  5461.  
  5462. @subsection Years and Days
  5463.  
  5464. @deffn WorldProperty @code{year-length} n
  5465. This property is the number of turns in an annual cycle.
  5466. If less than @code{2}, then no seasonal effects will be calculated.
  5467. Defaults to @code{0}.
  5468. @end deffn
  5469.  
  5470. @deffn WorldProperty @code{day-length} n
  5471. This property is the number of turns in a single day.
  5472. If less than @code{2}, then day and night will not be calculated.
  5473. Defaults to @code{0}.
  5474. @end deffn
  5475.  
  5476. Note that @code{year-length} and @code{day-length} are
  5477. completely independent of each other, and it is possible
  5478. to have days that are longer than years.
  5479.  
  5480. @deffn AreaProperty @code{initial-year-part} n
  5481. This property is the season of the first turn in the game.
  5482. Defaults to @code{0}.
  5483. @end deffn
  5484.  
  5485. @deffn AreaProperty @code{initial-day-part} n
  5486. This property is the hour of the first turn in the game.
  5487. Defaults to @code{0}.
  5488. @end deffn
  5489.  
  5490. [need amount of daylight, twilight, etc]
  5491.  
  5492. @deffn GlobalVariable @code{season-names} xxx
  5493. This global is a list of which turns in a year should be called
  5494. which seasons.  It has the form @code{(... (n1 n2 name) ...)}.
  5495. Defaults to @code{()}.
  5496. @end deffn
  5497.  
  5498. @node Seasonal Effects, Weather Parameters, Years and Days, Backdrop Environment Parameters
  5499.  
  5500. @subsection Seasonal Effects
  5501.  
  5502. @deffn UnitTypeProperty @code{acp-season-effect} xxx
  5503. This property is the effect of the seasons on acp.
  5504. This property is added to the basic @code{acp-per-turn}.
  5505. Defaults to @code{()}.
  5506. @end deffn
  5507.  
  5508. @deffn GlobalVariable @code{temperature-year-cycle} xxx
  5509. @end deffn
  5510.  
  5511. @node Weather Parameters, , Seasonal Effects, Backdrop Environment Parameters
  5512.  
  5513. @subsection Weather Parameters
  5514.  
  5515. While the seasons change relatively slowly and predictably,
  5516. weather can change drastically from turn to turn.
  5517. @c @i{Xconq} weather is based on a daily cycle of heating and cooling
  5518. @c plus the movement of water vapor.
  5519. @c 
  5520. @c Weather and seasons can be defined completely independently of each other.
  5521. @c The weather model assumes a constant basic temperature, set from
  5522. @c summer-equator if the season model is not being used.
  5523. @c 
  5524. @c Atmospheric vapor is modelled by having a vapor quantity in each cell
  5525. @c [define a layer for this].
  5526. @c Vapor originates with evaporation from terrain,
  5527. @c moves around with changing winds and air pressure,
  5528. @c and high levels result in clouds, rain, and snow.
  5529.  
  5530. @deffn TerrainTypeProperty @code{temperature-moderation-range} distance
  5531. This property is the radius of the area whose raw temperatures will be averaged
  5532. to get the actual temperature.
  5533. This can be very time-consuming to calculate,
  5534. so only values of 0 (no averaging)
  5535. and 1 (average with adjacent cells) are recommended.
  5536. Defaults to @code{0}.
  5537. @end deffn
  5538.  
  5539. @subsection Weather Effects
  5540.  
  5541. [effects of coating should be increased attrition, decreased
  5542. productivity, decreased activity and mobility]
  5543.  
  5544. @deffn UnitTypeProperty @code{acp-temperature-effect} xxx
  5545. This property is the effect of temperature on acp.
  5546. This property is multiplied with the final acp value (?).
  5547. Defaults to @code{()}.
  5548. @end deffn
  5549.  
  5550. @deffn UnitTypeProperty @code{consumption-temperature-effect} xxx
  5551. This property is the effect of temperature on material consumption.
  5552. Defaults to @code{()}.
  5553. @end deffn
  5554.  
  5555. @deffn UnitTypeProperty @code{temperature-attrition} xxx
  5556. This property is the effect of temperature on a unit's hp.
  5557. Defaults to @code{()}.
  5558. @end deffn
  5559.  
  5560. Transports can protect their occupants from temperature extremes.
  5561.  
  5562. @deffn Table @code{temperature-protection} u1 u2 -> t/f
  5563. @end deffn
  5564.  
  5565. The environmental conditions include temperature, coatings such as snow,
  5566. and atmospheric conditions.
  5567.  
  5568. [specify these]
  5569.  
  5570. The current environmental conditions in each cell
  5571. [or in world as a whole? or calc by regions?]
  5572. derive from a combination of three calculations:
  5573. random, seasons, and weather.
  5574.  
  5575. @node Backdrop Economy Parameters, Random Events, Backdrop Environment Parameters, Reference Manual
  5576.  
  5577. @section Backdrop Economy Parameters
  5578.  
  5579. The following parameters control the automatic production, distribution, and
  5580. consumption of materials by units and by cells.
  5581.  
  5582. @menu
  5583. * Unit Production and Consumption::  
  5584. * Terrain Production and Consumption::  
  5585. * Supply Lines::                
  5586. * Backdrop Trade::              
  5587. * Backdrop Taxation::           
  5588. * Material Conversion::         
  5589. @end menu
  5590.  
  5591. @node Unit Production and Consumption, Terrain Production and Consumption, , Backdrop Economy Parameters
  5592.  
  5593. @subsection Unit Production and Consumption
  5594.  
  5595. Units can be set to always produce some amount of material without
  5596. taking explicit action.
  5597.  
  5598. @deffn Table @code{base-production} u m -> n
  5599. This table is the basic amount of each material @var{m}
  5600. produced by a unit of type @var{u} in each turn.
  5601. Defaults to @code{0}.
  5602. @end deffn
  5603.  
  5604. @deffn Table @code{occupant-base-production} u m -> n
  5605. This table is the base production of each material @var{m}
  5606. when a unit of type @var{u} is an occupant.
  5607. Defaults to @code{0}.
  5608. @end deffn
  5609.  
  5610. @deffn Table @code{productivity} u t -> n%
  5611. This base is the percentage productivity of a unit
  5612. of type @var{u} when on terrain of type @var{t}.
  5613. This is multiplied with the basic production rate to get actual material
  5614. production, so productivity of @code{0} completely disables production on
  5615. that terrain type, and productivity of @code{100} yields the rate
  5616. specified by @code{base-production}.
  5617. Defaults to @code{100}.
  5618. @end deffn
  5619.  
  5620. @deffn Table @code{productivity-min} u m -> n
  5621. @end deffn
  5622. @deffn Table @code{productivity-max} u m -> n
  5623. These tables are the
  5624. lower and upper bounds on actual production after multiplying by
  5625. productivity.
  5626. Default to @code{0} and @code{9999}, respectively.
  5627. @end deffn
  5628.  
  5629. @deffn Table @code{base-consumption} u m -> n
  5630. This table
  5631. sets the amount of materials consumed by the unit in a turn, even if it
  5632. doesn't move or do anything else.
  5633. Defaults to @code{0}.
  5634. @end deffn
  5635.  
  5636. @deffn Table @code{hp-per-starve} u m -> hp
  5637. If the unit runs out of a material that it must consume,
  5638. this table specifies how many hp it will lose each turn that it is starving.
  5639. If starving for several reasons, loss is max of starvation losses,
  5640. not the sum.
  5641. Defaults to @code{0}.
  5642. @end deffn
  5643.  
  5644. @deffn Table @code{consumption-as-occupant} u m -> n%
  5645. This table is the consumption by a unit of type @var{u1} when it is
  5646. an occupant, expressed as a percentage of its @code{base-consumption}.
  5647. This is useful for units such as planes which always consume fuel
  5648. in the air but not on the ground.
  5649. Defaults to @code{100}.
  5650. @end deffn
  5651.  
  5652. @node Terrain Production and Consumption, Supply Lines, Unit Production and Consumption, Backdrop Economy Parameters
  5653.  
  5654. @subsection Terrain Production and Consumption
  5655.  
  5656. Materials may be produced by cells, redistributed, and also taken up
  5657. by units.  Some amount of material may need to stay in the cell's storage,
  5658. or the type of terrain might change.  Exhaustion is tested after all consumption
  5659. has been accounted for.
  5660.  
  5661. @deffn Table @code{terrain-production} t m -> n
  5662. This table is the amount of each material @var{m} produced by a cell of the given
  5663. type @var{t} in each turn.
  5664. Defaults to @code{0}.
  5665. @end deffn
  5666.  
  5667. @deffn Table @code{terrain-consumption} t m -> n
  5668. This table is the amount of material @var{m} consumed by a cell of type @var{t}
  5669. each turn.
  5670. If insufficient material is available, then the terrain may change type.
  5671. Defaults to @code{0}.
  5672. @end deffn
  5673.  
  5674. @deffn Table @code{change-on-exhaustion-chance} t m -> n%
  5675. This table is the chance that a cell of type @var{t}, with no supply of material
  5676. of type @var{m}, will become exhausted and change to its exhausted type.
  5677. @end deffn
  5678.  
  5679. @deffn Table @code{terrain-exhaustion-type} t1 m -> t2
  5680. If @var{t2} is not @code{non-terrain},
  5681. then this table says that any cell with terrain @var{t1}
  5682. that is exhausted will change to @var{t2}.
  5683. If several materials are
  5684. exhausted in the same turn, then the lowest-numbered material type
  5685. will determine the new terrain type.
  5686. Defaults to @code{non-terrain}.
  5687. @end deffn
  5688.  
  5689. @deffn Table @code{people-consumption} m1 m2 -> n
  5690. This table is the base consumption per turn
  5691. by people of type @var{m1} of each other material type @var{m2}.
  5692. Defaults to @code{0}.
  5693. @end deffn
  5694.  
  5695. @deffn Table @code{people-production} m1 m2 -> n
  5696. This table is the people of type @var{m1} base production per turn
  5697. of each other material type @var{m2}.
  5698. Defaults to @code{0}.
  5699. @end deffn
  5700.  
  5701. @node Supply Lines, Backdrop Trade, Terrain Production and Consumption, Backdrop Economy Parameters
  5702.  
  5703. @subsection Supply Lines
  5704.  
  5705. In real life, material production and consumption rarely occur in the same place
  5706. at the same time.
  5707. For some games, the player must transfer materials
  5708. manually, by loading and unloading from units.
  5709. However, this can be time-consuming and difficult,
  5710. and is best reserved for scarce and/or
  5711. valuable materials.
  5712. For more common materials, @i{Xconq} provides @dfn{supply lines}.
  5713.  
  5714. @deffn Table @code{in-length} u1 m -> dist
  5715. @end deffn
  5716. @deffn Table @code{out-length} u2 m -> dist
  5717. These two tables together determine the length of supply lines
  5718. between units.  The given type of material can only be transferred from
  5719. unit type @var{u1} to unit type @var{u2}
  5720. if the distance is less than the minimum of
  5721. the @code{in-length} of @var{u1} and the @code{out-length} of @var{u2}.
  5722. For instance, the @code{in-length} for a fighter's fuel might be 3 cells,
  5723. while the @code{out-length} of fuel from a city is 4 cells.
  5724. Then the fighter will be constantly supplied with fuel
  5725. when within 3 cells of a city.
  5726. If the fighter's out-length is -1, it will never
  5727. transfer any fuel to the city.
  5728. An in- or out-length of @code{0} means that the two units must be
  5729. in the same cell,
  5730. while a negative length disables the automatic transfer completely.
  5731. Long @code{out-length} lines should be used sparingly,
  5732. since the algorithm uses the @code{out-length} to
  5733. define a radius of search for units to be resupplied.
  5734. Both default to @code{0}.
  5735. @end deffn
  5736.  
  5737. @node Backdrop Trade, Backdrop Taxation, Supply Lines, Backdrop Economy Parameters
  5738.  
  5739. @subsection Backdrop Trade
  5740.  
  5741. [not yet implemented]
  5742.  
  5743. @c To move materials automatically between cells,
  5744. @c you must define the demand and supply relationships,
  5745. @c as well as the rate and distance that materials can move.
  5746.  
  5747. @c Demand for a material originates with consumption and
  5748. @c construction needs, issuing either from a side or from
  5749. @c some other part of the economy.
  5750.  
  5751. @node Backdrop Taxation, Material Conversion, Backdrop Trade, Backdrop Economy Parameters
  5752.  
  5753. @subsection Backdrop Taxation
  5754.  
  5755. [not yet implemented]
  5756.  
  5757. @c A side can set a taxation rate, which is the amount of material
  5758. @c that will be taken from the cell-based economy and given to units
  5759. @c on that side.
  5760.  
  5761. @c Taxes may be negative, which will have the effect of returning
  5762. @c materials from units back to cells.
  5763.  
  5764. @c Taxation is the last step in economic calculations.
  5765.  
  5766. @node Material Conversion,  , Backdrop Taxation, Backdrop Economy Parameters
  5767.  
  5768. @subsection Material Conversion
  5769.  
  5770. [not yet implemented]
  5771.  
  5772. @c Some types of materials can be converted or combined into other types
  5773. @c of materials.
  5774.  
  5775. @c [do by letting production vary according to consumption?]
  5776.  
  5777. @c [in general, should distinguish productive from consumptive units,
  5778. @c specify as limits on in/out for each rtype]
  5779.  
  5780. @node Random Events, Dates and Time, Backdrop Economy Parameters, Reference Manual
  5781.  
  5782. @section Random Events
  5783.  
  5784. @deffn GlobalVariable @code{random-events} method-list
  5785. This variable is a list of random event methods
  5786. that will be run at the end of each turn.
  5787. The list is not ordered.
  5788. @end deffn
  5789.  
  5790. @menu
  5791. * Terrain Attrition::           
  5792. * Terrain Accident::            
  5793. * Unit Revolt::                 
  5794. * Unit Surrender::              
  5795. @end menu
  5796.  
  5797. @node Terrain Attrition, Terrain Accident, Random Events, Random Events
  5798.  
  5799. @subsection Terrain Attrition
  5800.  
  5801. Attrition is the automatic loss of hit points due to being in certain types
  5802. of terrain.
  5803.  
  5804. @deffn Method @code{attrition-in-terrain}
  5805. For every unit not in a transport,
  5806. this method computes the chance to lose hit points,
  5807. then damages the unit accordingly.
  5808. This method runs once per turn.
  5809. @end deffn
  5810.  
  5811. @deffn Table @code{attrition} u t -> .01hp
  5812. This table is the rate of loss of hp per turn.
  5813. The terrain used is cell or connection terrain as appropriate for
  5814. the unit's position.
  5815. Defaults to @code{0}.
  5816. @end deffn
  5817.  
  5818. @node Terrain Accident, Unit Revolt, Terrain Attrition, Random Events
  5819.  
  5820. @subsection Terrain Accident
  5821.  
  5822. Accidents result in the damage or disappearance of a unit in the open
  5823. in some kinds of terrain.
  5824.  
  5825. @deffn Method @code{accidents-in-terrain}
  5826. For every unit not in a transport,
  5827. this method computes the chance to be hit or to vanish completely.
  5828. This method runs once per turn.
  5829. @end deffn
  5830.  
  5831. @deffn Table @code{accident-hit-chance} u t -> .01n%
  5832. This table is the chance of the unit being hit while in the given terrain.
  5833. Defaults to @code{0}.
  5834. @end deffn
  5835.  
  5836. @deffn Table @code{accident-damage} u t -> hp
  5837. This table is the hp that will be lost in an accident.
  5838. Defaults to @code{0}.
  5839. @end deffn
  5840.  
  5841. @deffn Table @code{accident-vanish-chance} u t -> .01n%
  5842. This table is the chance of the unit simply vanishing while in the given terrain.
  5843. Defaults to @code{0}.
  5844. @end deffn
  5845.  
  5846. @node Unit Revolt, Unit Surrender, Terrain Accident, Random Events
  5847.  
  5848. @subsection Unit Revolt
  5849.  
  5850. Revolt is a spontaneous change of side,
  5851. occurring in place of a side-given unit action.
  5852. The new side may be none (independence) or another side.
  5853. [only if other side wants it?] [50/50 chance?]
  5854.  
  5855. @deffn Method @code{units-revolt}
  5856. For each completed unit, this method decides whether the unit revolts,
  5857. then changes its side.
  5858. @end deffn
  5859.  
  5860. @deffn UnitTypeProperty @code{revolt-chance} .01n%
  5861. This property is the chance for the unit to revolt spontaneously.
  5862. Defaults to @code{0}.
  5863. @end deffn
  5864.  
  5865. @node Unit Surrender, , Unit Revolt, Random Events
  5866.  
  5867. @subsection Unit Surrender
  5868.  
  5869. @deffn Method @code{units-surrender}
  5870. For each completed unit, this method checks whether the unit will surrender
  5871. to a nearby unfriendly unit.
  5872. @end deffn
  5873.  
  5874. @deffn Table @code{surrender-chance} u1 u2 -> .01n%
  5875. This table is the chance that a unit of type @var{u1} will change its side
  5876. to match the side of a unit @var{u2} that is within the @code{surrender-range}
  5877. for the two types.
  5878. Defaults to @code{0}.
  5879. @end deffn
  5880.  
  5881. @deffn Table @code{surrender-range} u1 u2 -> dist
  5882. This table is the distance out to which a unit of type @var{u1}
  5883. will surrender to a unit of type @var{u2}.
  5884. Defaults to @code{1}.
  5885. @end deffn
  5886.  
  5887. @node Dates and Time, Image Families, Random Events, Reference Manual
  5888.  
  5889. @section Dates and Time
  5890.  
  5891. @deffn GlobalVariable @code{turn} n
  5892. This variable is the number of the current turn.
  5893. Defaults to @code{0}.
  5894. @end deffn
  5895.  
  5896. Note that the first turn of a game is actually turn 1.
  5897. Pre-game activities happen during ``turn 0''.
  5898.  
  5899. @menu
  5900. * Game Length::
  5901. * Calendar::
  5902. * Real Time::                   
  5903. @end menu
  5904.  
  5905. @node Game Length, Calendar, Dates and Time, Dates and Time
  5906.  
  5907. @subsection Game Length
  5908.  
  5909. @deffn GlobalVariable @code{last-turn} n
  5910. This variable is the number
  5911. of the last turn.
  5912. Defaults to @code{-1}, which means that there is no limit on the number
  5913. of turns.
  5914. @end deffn
  5915.  
  5916. @deffn GlobalVariable @code{extra-turn-chance} n%
  5917. This variable is the chance that the game will go one more turn
  5918. after the @code{last-turn}.
  5919. @end deffn
  5920.  
  5921. @i{Xconq} is currently limited to games of 32,767 turns.
  5922.  
  5923. @node Calendar, Real Time, Game Length, Dates and Time
  5924.  
  5925. @subsection Calendar
  5926.  
  5927. You can make @i{Xconq} display game time as a calendar date,
  5928. rather than as a simple turn number.
  5929.  
  5930. @deffn GlobalVariable @code{calendar} type data@dots{}
  5931. This variable is the description of the calendar type that will be used.
  5932. If @code{none}, then turns will be reported numerically starting
  5933. from @code{1}.  If @code{usual}, then the standard Gregorian
  5934. calendar will be used.
  5935. (Other calendars may be supported in the future.)
  5936. Defaults to @code{()}, which is equivalent to @code{(number "turn")}.
  5937.  
  5938. For the @code{usual} calendar, the @var{data} defines how long a turn is,
  5939. in terms of the calendar.
  5940. For instance, a time measure of @code{"day"}
  5941. (and a base date of @code{"1 Jan 1900"}) will result in turns
  5942. @code{"1 Jan 1900"}, @code{"2 Jan 1900"}, etc,
  5943. while a date unit of @code{"year"}
  5944. will yield just @code{"1900"}, @code{"1901"}, and so forth.
  5945.  
  5946. If the numeric or @code{number} calendar is in use, then a @var{data} of @code{"day"}
  5947. will yield @code{"day 1"}, @code{"day 2"}, etc.
  5948.  
  5949. The rest of this variable lists the name of each season
  5950. and the turns within a year for which it is appropriate.
  5951. A twelve-turn year with four seasons could be
  5952. @example
  5953. ((0 2 "winter") (3 5 "spring") (6 8 "summer") (9 11 "autumn"))
  5954. @end example
  5955. If any number ranges overlap, then the first match will be used,
  5956. while if a particular turn has no named season, then it will go
  5957. unnamed in the display.
  5958. @end deffn
  5959.  
  5960. @deffn Symbol @code{none}
  5961. @end deffn
  5962. @deffn Symbol @code{usual}
  5963. @end deffn
  5964.  
  5965. @deffn GlobalVariable @code{initial-date} str
  5966. This variable is the date, in the specified calendar system, of the first turn.
  5967. Defaults to @code{""}, which has the effect of setting the initial date
  5968. to be whatever the calendar does with turn number 1.
  5969. @end deffn
  5970.  
  5971. @node Real Time, , Calendar, Dates and Time
  5972.  
  5973. @subsection Real Time
  5974.  
  5975. A game may also be limited in real time.
  5976.  
  5977. @deffn GlobalVariable @code{real-time-for-game} seconds
  5978. @end deffn
  5979.  
  5980. @deffn GlobalVariable @code{real-time-per-turn} seconds
  5981. @end deffn
  5982.  
  5983. @deffn GlobalVariable @code{real-time-per-side} seconds
  5984. @end deffn
  5985.  
  5986. @deffn GlobalVariable @code{elapsed-real-time} seconds
  5987. This is the difference in real time between the start of the game
  5988. and its current state.
  5989. @end deffn
  5990.  
  5991. @node Image Families, Other Forms, Dates and Time, Reference Manual
  5992.  
  5993. @section Image Families
  5994.  
  5995. The @code{imf} form defines graphical images in a
  5996. platform-independent way.
  5997. An @i{image family} is a named collection of images of varying
  5998. sizes and depths.
  5999.  
  6000. @deffn Form @code{imf} name [properties] [images]
  6001. This form declares an image family to exist, with the name @var{name}
  6002. and @var{properties}, and consisting of the specified @var{images}.
  6003. Each image has the form
  6004. @code{((@var{w} @var{h} [tile]) [@var{properties}] (@var{type} @var{data}...) ...)},
  6005. where @var{w} and @var{h} are its width and height, respectively,
  6006. the @var{type} may be one of @code{color}, @code{mono}, or @code{mask},
  6007. and the @var{data} consists of strings of hexadecimal digits.
  6008. The data strings may include slashes, which have no effect on interpretation,
  6009. but are useful to indicate each row of an image.
  6010. Color images may also have additional properties, which come between the
  6011. @var{type} and the @var{data}.
  6012.  
  6013. Multiple forms with the same name may occur, and each adds to the family,
  6014. overwriting individual image parts that are of the same size and depth.
  6015.  
  6016. @end deffn
  6017.  
  6018. @deffn Symbol @code{tile}
  6019. If this symbol appears following the dimensions of an image,
  6020. it indicates that the image is a pattern tile rather than a single image.
  6021. @end deffn
  6022.  
  6023. @deffn ImageProperty @code{actual} w h
  6024. This property is the actual size of the image data. [Ever really used?]
  6025. @end deffn
  6026.  
  6027. @deffn ImageProperty @code{embed} name
  6028. This property specifies that another image, similar to the image family
  6029. named by @var{name}, is already embedded within the image, and so @i{Xconq}
  6030. need not superimpose such an image itself.  This may occur when an image
  6031. has a ``builtin'' side emblem, or is readily identifiable as belonging
  6032. to a particular side, and it would be redundant for @i{Xconq} to add an
  6033. emblem when displaying a unit.
  6034. @end deffn
  6035.  
  6036. @deffn ImageProperty @code{embed-at} x y w h
  6037. @end deffn
  6038.  
  6039. @deffn ImageProperty @code{mono} data...
  6040. This property indicates that the data represents a monochrome image.
  6041. @end deffn
  6042.  
  6043. @deffn ImageProperty @code{mask} data...
  6044. This property indicates that the data represents a mask.
  6045. @end deffn
  6046.  
  6047. @deffn ImageProperty @code{color} [properties] data...
  6048. This property indicates that the data represents a color image.
  6049. @end deffn
  6050.  
  6051. @deffn ColorImageProperty @code{pixel-size} n
  6052. This property is the number of bits used to encode each pixel.
  6053. @end deffn
  6054.  
  6055. @deffn ColorImageProperty @code{row-bytes} n
  6056. This property is the number of bytes in each row of the image.
  6057. @end deffn
  6058.  
  6059. @deffn ColorImageProperty @code{palette} [ name | (index r g b) ... ]
  6060. This property is the color palette that should be used with the image.
  6061. @end deffn
  6062.  
  6063. @deffn Form @code{palette} name (index r g b) ...
  6064. This form defines a palette with the given @var{name}.
  6065. @end deffn
  6066.  
  6067. @deffn Form @code{color} name r g b
  6068. This form names the color.
  6069. @end deffn
  6070.  
  6071. Note that for the purposes of stability and change tracking,
  6072. tools that generate image families use a more restricted format.
  6073. This format requires a separate imf form for each size of image,
  6074. the size is on the same line as the imf name, and each image/mask
  6075. is on a separate line, indented by 2. (See the existing @code{lib/*.imf}
  6076. files for further detail.)
  6077.  
  6078. @node Other Forms,  , Image Families, Reference Manual
  6079.  
  6080. @section Other Forms
  6081.  
  6082. GDL forms in this section are those that do not really fit anywhere
  6083. else.
  6084.  
  6085. @menu
  6086. * Default Display Style::
  6087. * The Random State::
  6088. * Debugging Support::                   
  6089. * Internal AI Data::            
  6090. @end menu
  6091.  
  6092. @deffn UnitTypeProperty @code{name-internal} str
  6093. Internally used type name.
  6094. @end deffn
  6095.  
  6096. @node Default Display Style, The Random State, , Other Forms
  6097.  
  6098. @subsection Default Display Style
  6099.  
  6100. The exact style of display depends on the user interface and
  6101. on user preferences,
  6102. but for some games, you may want to encourage a particular style
  6103. by making it be the default.
  6104.  
  6105. @deffn GlobalVariable @code{unseen-char} str
  6106. This variable is a string whose first character will be used to
  6107. represent unexplored terrain.
  6108. If the string consists of two characters, the second char will be
  6109. scattered throughout a field of the first char.
  6110. Defaults to @code{""}.
  6111. @end deffn
  6112.  
  6113. @deffn GlobalVariable @code{unseen-color} str
  6114. This variable is the name of a color that will be used to
  6115. represent unexplored terrain.
  6116. Defaults to @code{""}.
  6117. @end deffn
  6118.  
  6119. @deffn GlobalVariable @code{unseen-image-name} str
  6120. This variable is the name of an image that will be used to
  6121. represent unexplored terrain.
  6122. Defaults to @code{""}.
  6123. @end deffn
  6124.  
  6125. @deffn GlobalVariable @code{grid-color} str
  6126. This variable is the name of a color to use to draw the
  6127. cell-separating grid.
  6128. Defaults to @code{""}.
  6129. @end deffn
  6130.  
  6131. @node The Random State, Debugging Support, Default Display Style, Other Forms
  6132.  
  6133. @subsection The Random State
  6134.  
  6135. It is useful to be able to restart the random number generator
  6136. consistently.
  6137.  
  6138. @deffn GlobalVariable @code{random-state} n
  6139. This variable is the state of the random number generator.
  6140. If this is not used, then the initial state of the random number
  6141. generator will be set in a system-dependent way.
  6142. @end deffn
  6143.  
  6144. @node Debugging Support, Internal AI Data, The Random State, Other Forms
  6145.  
  6146. @subsection Debugging Support
  6147.  
  6148. @deffn Form @code{print} value
  6149. This form prints to a console (or whatever the interface provides)
  6150. the object @var{value}, in GDL syntax.
  6151. @end deffn
  6152.  
  6153. @node Internal AI Data,  , Debugging Support, Other Forms
  6154.  
  6155. @subsection Internal AI Data
  6156.  
  6157. These are normally computed and used internally by AIs.
  6158. They can be filled in by a game design, but the effects
  6159. are undocumented and will depend on the working of the AI
  6160. using these forms.
  6161.  
  6162. @deffn XXX @code{zz-fr}
  6163. @end deffn
  6164.  
  6165. @deffn XXX @code{zz-b}
  6166. @end deffn
  6167.  
  6168. @deffn XXX @code{zz-bb}
  6169. @end deffn
  6170.  
  6171. @deffn XXX @code{zz-transport}
  6172. @end deffn
  6173.  
  6174. @deffn XXX @code{zz-c}
  6175. @end deffn
  6176.  
  6177. @deffn XXX @code{zz-cm}
  6178. @end deffn
  6179.  
  6180. @deffn XXX @code{zz-cc}
  6181. @end deffn
  6182.  
  6183. @deffn XXX @code{zz-bw}
  6184. @end deffn
  6185.  
  6186. @deffn Table @code{zz-basic-hit-worth}
  6187. @end deffn
  6188.  
  6189. @deffn Table @code{zz-basic-capture-worth}
  6190. @end deffn
  6191.  
  6192. @deffn Table @code{zz-basic-transport-worth}
  6193. @end deffn
  6194.